fix(watcher): keep a full scan owed after a failed sync (#1964) - #1977
Merged
colbymchenry merged 1 commit intoSep 27, 2026
Merged
Conversation
…#1964) A directory removal adds no pending file, only needsFullScan. The retry after a failed sync (lock contention or a generic failure) was gated on pending files alone, so the owed full reconcile was dropped and the removed directory's files kept their nodes. Reschedule while needsFullScan is set as well. A regression test also pins the mid-sync scope-change case, which already follows a scoped pass with a full scan. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
|
Thanks @danusha2345! Verified this against current |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1964.
Problem
A removed directory sets
needsFullScanwithout adding topendingFiles. The watcher's reschedule gate after a failed sync checked onlypendingFiles, so when that full scan failed (lock contention or an error) it was never retried. The removed directory's symbols stayed in the index until an unrelated edit triggered another sync.Fix
Reschedule while
needsFullScanis set as well:this.pendingFiles.size > 0 || this.needsFullScan. This is the same one-line change #1875 carries for HDL filelists, split out so the bug is fixed independently of that PR.Tests
watcher.test.ts:main);.gitignorechange, that arrive during a scoped sync each get a full scan after that sync. Both already pass onmainwhen driven through the watch-event path, so they only pin that behaviour. I couldn't reproduce the mid-sync case from the issue this way; if it goes throughingestEventForTests, the gate change covers it too.Full suite on this branch (Linux, Node 22, native kernel): all tests pass except the known
extraction.test.tspool-worker crash from #1779 (fixed by #1883), which is intermittent and also occurs onmain; that file alone passes 655/655.🤖 Generated with Claude Code