Conversation
|
I see you added the "on stage" label, I'll get this merged to the stage branch! |
|
View your CI Pipeline Execution ↗ for commit e3ac9aa
☁️ Nx Cloud last updated this comment at |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughUpdate to the Changes
Sequence Diagram(s)sequenceDiagram
participant Client as Client
participant Resolver as "me Resolver\n(src/schema/user/user.ts)"
participant DB as "Prisma\nDatabase"
participant Queue as "verifyUser\n(Email enqueue)"
rect rgba(200,200,255,0.5)
Client->>Resolver: call me query (with email)
end
rect rgba(200,255,200,0.5)
Resolver->>DB: prisma.user.update(...) -> updatedUser
DB-->>Resolver: updatedUser (email, emailVerified)
end
alt updatedUser.emailVerified == false
rect rgba(255,230,200,0.5)
Resolver->>Queue: verifyUser(updatedUser.id, updatedUser.email, {app:'NextSteps'})
alt enqueue succeeds
Queue-->>Resolver: enqueued
else enqueue fails
Queue--x Resolver: error
Resolver->>Resolver: console.error(error)
end
end
else already verified
Note over Resolver: no verifyUser call
end
Resolver-->>Client: return updatedUser (no errors)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apis/api-users/src/schema/user/user.ts`:
- Around line 121-128: The current code awaits verifyUser(...) after updating
the user, so if enqueueing verification rejects it causes the whole me query to
fail; change this by decoupling verification from the happy path: after
detecting updatedUser.emailVerified is falsy, invoke verifyUser with the same
arguments (ctx.currentUser.id, ctx.currentUser.email, input?.redirect,
input?.app ?? 'NextSteps') but do not let its failure bubble up — either call it
without awaiting (fire-and-forget) or wrap the await in a try/catch and log the
error (don’t rethrow), ensuring the user update result is returned even if
verification enqueue fails.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 8eb2ee5d-3c47-4a79-affc-49fdd68683cb
📒 Files selected for processing (2)
apis/api-users/src/schema/user/user.spec.tsapis/api-users/src/schema/user/user.ts
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Summary by CodeRabbit
Bug Fixes
Improvements
Tests