Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughImplements cookie-based persistence of the last selected email account. Adds server actions to read/write a cookie, updates redirect logic to prefer the cookie value, and adds a provider effect to set the cookie when selection changes. Introduces a cookie constant and bumps version to v2.16.6. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor U as User
participant B as Browser
participant S as Next.js Server
participant A as account.ts
participant C as Cookie Store
U->>B: Navigate to /app
B->>S: HTTP request
S->>A: resolveAccountRedirect()
A->>C: read LAST_EMAIL_ACCOUNT_COOKIE
alt cookie present and valid
A-->>S: redirect to /app/accounts/{emailAccountId}
else cookie missing/invalid
A-->>S: fallback to first account or notFound()
end
S-->>B: Redirect/Response
sequenceDiagram
autonumber
participant V as EmailAccountProvider
participant SA as setLastEmailAccountAction
participant C as Cookie Store
Note over V: emailAccountId changes
V->>SA: setLastEmailAccountAction(emailAccountId)
SA->>C: Set LAST_EMAIL_ACCOUNT_COOKIE = emailAccountId<br/>(httpOnly, path=/, maxAge=1y, sameSite=lax, secure in prod)
SA-->>V: done
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (5)
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.
1 issue found across 5 files
Prompt for AI agents (all 1 issues)
Understand the root cause of the following 1 issues and fix them.
<file name="apps/web/utils/account.ts">
<violation number="1" location="apps/web/utils/account.ts:123">
Ensure the cookie-sourced emailAccountId is validated against the authenticated user's accounts before using it; otherwise fall back to the first account.</violation>
</file>
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
Summary by CodeRabbit
New Features
Chores