Repository navigation
Keep one local project after concurrent registration - #26789
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthroughLocal repository registration now checks for an existing repository after icon discovery and returns it instead of adding a duplicate. Unit and end-to-end tests cover concurrent registrations, linked worktrees, persisted repository identity, and missing paths. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The registration change is mergeable after normal checks; no actionable issue remains identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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 |
ELI5
Adding the same local project several times at once now keeps one project instead of creating duplicates.
What Changed
Recheck the existing normalized input, repository-root, and linked-main-checkout identities after icon discovery, immediately before insertion. Git and folder projects retain their current host/path rules; SSH records are excluded. There is no await between the final check and insertion.
Why
The race predates async Git detection: registration already waited for icon discovery. Reusing the existing identity rules closes that gap without a lock, cache, or second ownership store.
Visual Proof
N/A — no layout change. Real hidden Electron tests launch six concurrent root/nested adds, verify exactly one authoritative row and eventual renderer ID, then verify linked-checkout reuse and missing-path refusal.
Testing
Head
b4ce9df98f1f784e9fd79e5f0574b1eeed3c7c89, base main69cf557a698bf25f4bae24d39c19fb1fd8bc13aa.Three deterministic regression cases fail before the change; all 10 registration tests pass after it.
macOS hidden Electron concurrency test passes. Revised core containing this fix also passes the same six-call test on native Windows.
The original CI renderer-count assertion assumed an awaited catalog fetch always applied. A controlled real-store interleaving reproduces 0 immediately, then the exact winner ID after the latest fetch. The test now checks authoritative rows and uses the existing settlement boundary plus eventual renderer identity.
Changed-code quality against original baseline
6a15cd8972bfpasses; CLI/web typechecks pass. Full typecheck has the baseline limitation below.Manually exercised hidden Electron
Automated tests added/updated
Merge this PR first, then #26760, then its two independent consumer PRs.
Linked Issue
Part of the repository-detection audit in #20497; split from #26760. This does not close the broader audit.
Review
Review the focused diff against the named base. Original code and evidence are preserved at
backup/pr26760-original-72208-task1cc89eeb.Agent skill upstream boundary
Notes
All app tests launch hidden with
ORCA_BACKGROUND_LAUNCH=1. No foreground/focus tests, OS picker automation, release packaging, or full suite claim. New CI has run static checks; the baseline failure is recorded below.Checklist
command-receipt-transaction.test.ts:107; reproduced on pristine main and each branch. CLI/web typechecks pass.Split and merge order
The original head
72208aa57e9band its full evidence remain preserved; #26760 was narrowed through forward-only commits. No PR in this stack has been merged.Current CI at this exact head: FAILURE in static analysis/typecheck on the unchanged main journal fixture:
command-receipt-transaction.test.ts(107,39)/ TS2345 (readonly JournalRow[]passed toJournalRow). This matches the pristine-main and local branch reproduction; aggregate verify fails with that prerequisite. Other pending/skipped lanes do not establish a full-suite pass. No unrelated journal fix is included in this PR.