fix: normalize Windows backslash paths in file watcher to fix tree refresh - #41931
Open
skyzhao1223 wants to merge 2 commits into
Open
fix: normalize Windows backslash paths in file watcher to fix tree refresh#41931skyzhao1223 wants to merge 2 commits into
skyzhao1223 wants to merge 2 commits into
Conversation
added 2 commits
August 11, 2026 16:19
…fresh
File tree and file viewer do not auto-refresh after AI edits on
Windows because path.normalize() preserved backslashes while
tree-store and watcher's split('/') expected forward slashes.
- path.normalize() now converts backslashes to forward slashes on
Windows, consistent with normalizeDir() and encodeFilePath()
- watcher.invalidateFromWatcher() adds defensive path normalization
- Updated test expectations for Windows path normalization
Closes anomalyco#38125
The session VCS refresh listener uses startsWith('.git/') to skip
.git-internal watcher events, but on Windows the raw watcher path
may contain backslashes, allowing .git changes to slip through.
Use replace() to normalise separators before the prefix check.
Related: anomalyco#41704
Contributor
|
The following comment was made by an LLM, it may be inaccurate: Found a potential duplicate: PR #41240: This PR appears to address the same issue as the current PR #41931 — normalizing file watcher paths on Windows by converting backslashes to forward slashes. Both PRs target path normalization in the file watcher to fix tree refresh behavior. You should check if PR #41240 is already merged or if it's still open, as it may duplicate the work being done in PR #41931. |
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.
Issue for this PR
Closes #38125
Type of change
What does this PR do?
File tree and file viewer do not auto-refresh after AI edits on Windows because path.normalize() preserved backslashes while tree-store and watcher's split('/') expected forward slashes, causing path lookup mismatches and preventing directory refresh.
How did you verify your code works?
Checklist