fix(auth): prioritize exact accountId during credential import - #1656
fix(auth): prioritize exact accountId during credential import#1656luvs01 wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe OAuth credential upsert logic now uses a reusable email-only matcher after exact ChangesOAuth identity matching
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized credential-import fix prioritizes exact account identity matches and preserves legacy fallback behavior; no actionable merge-blocking risk remains after normal checks and review. Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 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 |
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
⏳ DRAFT
What to do
Review readiness checklist
✅ 4/4 boxes ticked. This pull request was already a draft. Its draft status will be preserved after every issue above is resolved. |
7192129 to
b525150
Compare
lidge-jun
left a comment
There was a problem hiding this comment.
[Repository bug audit · 2026-08-14]
The change is precise and low risk: exact stable accountId matching is evaluated across the full account set before falling back to an email-only legacy row, and the regression protects active-account selection and duplicate identity count.
No code-level blocker found. Rebase onto current dev, resolve the shared OAuth-store overlap with #1663, and rerun account-import/OAuth-store tests plus exact-head CI. Prefer landing this focused identity-selection fix before the broader forced-login preservation change.
|
Cherry-picked onto dev as part of the bug resolution campaign (commit-and-merge loop). Changes verified with typecheck and focused tests. |
Summary
accountIdbefore considering a legacy email-only migration row.The previous single-pass predicate performed email fallback while scanning each row. An earlier email-only row could therefore win before a later exact
accountIdrow was examined, leaving the stable row stale and creating duplicate stable identities after the update.Verification
devata1e5192b75edbf6dcacae51a30912fab93906f87; exact head:b525150e6f40af7579d68d0c2ff762d02dde414f.bun test --isolate tests/account-import.test.ts— 19 pass, 0 fail.bun run typecheckpassed on both runtimes.bun run privacy:scanandgit diff --checkpassed.Checklist
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
All CI tests are green on my local testing.
I pushed my PR to the latest dev commit.
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.
Summary by CodeRabbit
Bug Fixes
Tests