Repository navigation
Conversation
|
Warning Review limit reachedNext included review available in 3 minutes. View limit detailsLimit details: You’ve used all 10 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (13)
📝 WalkthroughWalkthroughThe change adds shallow native filesystem subscriptions with included path patterns and asynchronous disposal. The watcher process selects shallow or recursive subscriptions and forwards events and errors over IPC. Primary Git metadata now uses a shallow watcher with status-reference polling and fallback polling. Local macOS, Linux, and Windows worktree watching uses separate narrow and primary subscriptions, while unsupported platforms retain full polling. Tests cover watcher events, platform options, recovery, visibility, interruption, and disposal. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description explains the problem, design, implementation, safety considerations, testing, and validation gap. However, it does not follow the repository template and omits the required linked issue, Visual Proof entry, checklist, and several required section headings. Resolution Add the required template sections. Include a valid issue reference after "Fixes #". Add ✨ 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 |
d2d44c2 to
dd8ec43
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/main/ipc/worktree-git-common-watch.test.ts (1)
181-196: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy liftAdd and run native watcher integration tests before release.
The unit tests mock
subscribeViaWatcherProcessand@parcel/watcher. Exercise real filesystem mutations through the watcher child on macOS, Linux, and Windows.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 0aee0fea-25f3-442f-8f9c-80b9fe909dd9
📒 Files selected for processing (9)
src/main/ipc/parcel-watcher-process-entry.test.tssrc/main/ipc/parcel-watcher-process-entry.tssrc/main/ipc/parcel-watcher-process-protocol.tssrc/main/ipc/parcel-watcher-shallow-subscription.test.tssrc/main/ipc/parcel-watcher-shallow-subscription.tssrc/main/ipc/worktree-git-common-primary-polling.tssrc/main/ipc/worktree-git-common-primary-watch.tssrc/main/ipc/worktree-git-common-watch.test.tssrc/main/ipc/worktree-git-common-watch.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 1 remains after this review.
dd8ec43 to
3a31b9e
Compare
|
Closing as superseded after checking current Superseded by merged #16404, which delivered event-driven local Git metadata observation without a scheduler. Main already uses the native watcher, fallback, and reconciliation approach; this branch's separate polling scheduler is an alternative implementation of work already delivered. Closing this PR only; its branch is being retained. |
Problem
Local Git-common metadata observation repeatedly scanned every linked worktree even while idle. With E linked worktrees, the recurring path was approximately:
That background work competes with renderer updates, Git subprocesses, and worktree interaction. The live responsiveness incident showed the need to remove the linked-worktree scan from the healthy path without changing remote behavior.
Design
The full design is in
docs/reference/git-metadata-event-driven-refresh.md.Healthy local observation now follows:
Fallback remains:
The change deliberately does not introduce a new remote protocol, local watcher for SSH/WSL paths, or renderer subscription model.
Implementation
Linked worktree metadata
<common>/.git/worktrees.Primary checkout metadata
Adds a shallow watcher mode to the existing watcher-child protocol:
The shallow implementation:
logsdirectory separately when present;updateevents;The healthy local primary path no longer stats the six primary files every poll. Selected upstream ref paths remain on a bounded targeted stat poll. If the shallow watcher fails, the six-file poll is restored.
Safety and compatibility
Verification
Passed:
Also passed:
The focused tests cover:
Validation gap
A real native filesystem-event smoke test still needs to run on physical macOS, Linux, and Windows hosts. This environment did not deliver reliable Darwin
node:fs.watchevents, so the new shallow behavior is covered deterministically through mocked native callbacks and watcher-child protocol tests.Required follow-up validation before merge:
git worktree prunetest.Prior-art references