Repository navigation
fix(auth): recover verified sessions and guard wallet initialization - #3032
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
Code-analysis diffPainscore total: 7283.46 → 7287.43 (+3.97) 🆕 New findings (63)
…and 43 more. ✅ Resolved (62)
…and 42 more. 📈 Painscore deltas (top movers)
|
🧪 UI test report — ✅ all greenSuites
📊 Coverage (unit)
⏱ 10 slowest test cases
|
There was a problem hiding this comment.
Chip review — changes requested
The auth and kernel ownership changes are well covered, but the new wallet-readiness gate can trap active-card users in a non-dismissible modal.
Findings
- BLOCKING · src/components/Home/EnableAutoBalanceBanner.tsx:111 · Keep an escape when wallet initialization fails
When an ACTIVE card lackshasWithdrawApprovaland the primary kernel build exhausts its retries,isKernelClientReadystays false. This prevent-close modal then renders with Continue disabled; Skip for now is only added after a grant attempt, but this gate prevents that attempt, so the user cannot reach Home even though the provider intentionally keeps the session alive. Remove this readiness gate and letgrant()awaitensureClientForChain, or show an immediate retry/Skip action while readiness is false.
Checked clean
- Verified the detached HEAD, exact merge base, trusted author, and dev base ref.
- Traced web and native passkey token capture through ceremony commit, login hydration, and replacement-session query guards.
- Checked kernel-client build sequencing, cache invalidation, lazy-chain readiness, and session-key grant ownership.
- Checked setup initialization timeout, missing-step recovery, username-collision handling, and their focused tests.
- Exact-head unit, typecheck, eslint, format, and related completed checks passed. Advisory ds-shots failed in its duplicate Next build after compilation without an actionable source diagnostic; native export and preview were still running when inspected.
- Local Jest and TypeScript binaries were absent from the detached read-only worktree, so no duplicate local run was possible.
Security review by moonshotai/kimi-k3: 0 finding(s), marked with the model name. It reads the diff only and answers only security, privacy and money, so treat its findings as advice.
Third opinion by claude-opus: 0 finding(s), marked with the model name. It answers only product truth, missing tests and the cross-repo contract, so treat its findings as advice.
Exact head: cb3bbbd69986 · Context: repo, sibling-api, ci · Took 22m
There was a problem hiding this comment.
Chip review — no blocking findings — this is not an approval
Clean review: both prior wallet-initialization lockout findings are fixed, and the auth, session-hydration, credential-ownership, and setup-recovery changes introduce no actionable defect.
Checked clean
- Pinned checkout, trusted author, PR metadata, dev base ref, exact base SHA, exact head SHA, and merge base all match the supplied review target.
- Earlier P1 is FIXED: Continue is no longer disabled by wallet readiness, and a failed readiness wait reaches the existing retry/skip recovery without submitting an approval.
- Earlier P2 is FIXED: wallet initialization remains awaitable, but the blocking modal keeps an enabled escape path before and after an initialization failure.
- Passkey verify-token capture was traced through the API response contract, ceremony-scoped stash, web/native token persistence, invite acceptance, badge claims, and login hydration.
- Session replacement was checked across query cancellation, AbortSignal handling, token/clear-epoch guards before and after JSON parsing, bounded retries, and timeout cleanup.
- Kernel-client initialization was checked for disposed builds, superseded rebuilds, credential changes, cache invalidation, owner-address validation, readiness publication, and reconnect recovery.
- Setup initialization was checked for missing steps, empty layout state, session and authenticator timeouts, late completions, unsupported-device/browser branches, retry reload, and support access.
- Registration collision handling was checked against both API 409 sites, the post-availability-check race, ceremony cleanup, retry suppression, recovery UI, and analytics deduplication.
- Security, adversarial, and slop passes found no additional actionable privilege, token-exposure, stale-signing, dead-code, or architecture-drift issue in the changed behavior.
- Exact-head unit, typecheck, eslint, format, design-system lint, native export, analysis/build, preview, policy, and aggregate CI checks succeeded. The advisory ds-shots duplicate build exited during webpack without an actionable source diagnostic while the independent build paths passed.
- Local tests were not repeated because the detached worktree has no installed Jest binary; exact-head unit CI completed successfully.
Security review by moonshotai/kimi-k3: 0 finding(s), marked with the model name. It reads the diff only and answers only security, privacy and money, so treat its findings as advice.
Third opinion by claude-opus: 0 finding(s), marked with the model name. It answers only product truth, missing tests and the cross-repo contract, so treat its findings as advice.
Exact head: 6dd14c4de658 · Context: repo, api · Took 18m
🖼 Visual diff — 11 screens moved19 of 68 shots changed · 49 identical · baseline
job summary · before/after/diff images — artifact Fixture screenshots, no backend. Advisory — this check never blocks a merge. Posted from the default branch by ds-shots-comment.yml; the report it renders is untrusted data. |
After a successful passkey verification, login can stall before loading the authenticated user, and a second ceremony can race that transition. Login now cancels obsolete user queries, retries session hydration with a deadline, and keeps the transition exclusive until the verified key can be published. User responses that belong to a replaced or cleared session cannot update the session token or user store.
Kernel initialization now respects build ownership: obsolete results cannot force logout or overwrite a rebuild, and replacing a credential invalidates its cached signing clients while the new client initializes. Session-key grants await client readiness. The auto-balance entry point stays usable while the wallet is not ready so a failed initialization can surface its existing retry/skip recovery instead of trapping the user behind a disabled Continue button. Genuine stale-key rejection remains enforced.
Passkey verification retains the session token on web as well as native before invite acceptance and badge claims. Retry/HTTP diagnostics become breadcrumbs, and the signup component owns the single unexpected-failure exception and normalized analytics event. Expected cancellation/readability errors do not create exception duplicates. Register 409 USERNAME_TAKEN is preserved before the SDK decodes an error response as credential data. A collision after the availability check now shows the existing username-taken login recovery, emits one normalized failure event, and does not retry registration or rename the username.
Setup now shows retry and support actions when the current or entry step is missing, initialization fails, or layout/session/authenticator initialization exceeds its deadline. Retry reloads the page to restart the layout and session providers. Late or unmounted initialization results cannot change the selected step. Existing localized wording and the support drawer are reused.
Tasks: TASK-21392, TASK-21391, TASK-21644, TASK-21932, TASK-21404, and TASK-21385.
Validation:
Remaining acceptance gaps:
Based on origin/dev at fd63d01; existing #2801, #2880 and #3002 were inspected before implementation. No new app copy is introduced.