fix(app): normalize watcher paths#24341
Conversation
|
The following comment was made by an LLM, it may be inaccurate: The search found one potentially related PR: fix(watcher): filter ignored paths before publishing events, handle worktree git dirs - This PR also addresses watcher path handling, though it focuses on filtering ignored paths and handling git worktree directories rather than normalizing Windows path separators. It could be related depending on whether there's overlap in the watcher path processing logic. However, this appears to be a different issue (PR #21453 is about filtering ignored paths, while PR #24341 is about normalizing path separators on Windows). No other duplicate PRs found addressing the same issue #17780 or the same path normalization problem. |
|
#21453 is related to watcher processing, but it addresses a different layer:
So the two changes should be complementary rather than duplicates. |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Closes #17780
Type of change
What does this PR do?
Watcher events on Windows can arrive with backslash-separated paths while open tabs and cached file tree entries are keyed with forward slashes. This normalizes watcher-side paths before matching open files or loaded file tree nodes. It also refreshes the nearest loaded ancestor for
add/unlinkevents so changes under unloaded child directories still update the visible tree.This intentionally keeps the fix scoped to the watcher invalidation path rather than changing general path normalization behavior.
How did you verify your code works?
bun test --preload ./happydom.ts ./src/context/file/watcher.test.tsfrompackages/appbun test --preload ./happydom.ts ./src/context/file/path.test.ts ./src/context/file/watcher.test.tsfrompackages/appbun typecheckfrompackages/appbun turbo typecheckScreenshots / recordings
N/A, non-UI change.
Checklist