test(auth): cover session store failure, store swap, and generic OAuth2 - #28
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthrough
ChangesAuthentication failure and provider flows
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
Closes the
auth failure pathscoverage-debt gap.Changes
getSession()now catches session-storelookup errors (DB down / connection lost), logs a warning, and returns
nullinstead of propagating the error — so
/api/auth/sessionresponds401rather than crashing with a
500on every authenticated request.@thexjs/auth→patchchangeset added.packages/auth/src/auth-failures.test.ts(7 tests):getSession()returnsnull;/api/auth/sessionreturns401, not500.config.storeis the live store reference, so a mid-flightswap takes effect but does not migrate sessions (old store keeps them
intact, so swapping back restores access).
callback → session flow, including custom token params, userinfo profile
mapping, and state-challenge rejection.
auth.test.ts+auth-failures.test.ts).Verification
bun run lint— cleanbun run typecheck— cleanbun test— 208 pass / 6 skip / 0 failbunx @changesets/cli status --since origin/main— passesSummary by CodeRabbit
Bug Fixes
Tests
Documentation