You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Refresh content mapper configuration when open watched files are saved - #65446
Saving an open watchedFiles file could leave content mapper types stale: an earlier edit refreshed configuration from old disk content, while subsequent save/watch notifications were suppressed by the overlay.
Invalidation: Preserve disk changes hidden by overlays in FileChangeSummary.DiskChanged and include them when refreshing affected mapper projects, without marking overlay source text as changed.
Regression coverage: Exercise edit → request → save with save-only, watch-only, and combined notifications; verify unrelated open files do not reopen the mapper.
CopilotAI
changed the title
[WIP] Fix openProject re-run on saving watchedFiles
Refresh content mapper configuration when open watched files are saved
Nov 11, 2026
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Configuration invalidation can be lost after save-then-edit sequences or missed through node_modules symlink aliases, leaving mapper configuration stale.
This PR addresses stale content mapper configuration when a watched file is saved while open in the editor, separating disk notifications from overlay source-text changes.
Changes:
Track overlay-hidden disk changes in FileChangeSummary.
Use disk changes to refresh affected mapper projects while excluding unsaved overlay edits.
Add regression coverage for save-only, watch-only, combined notifications, and unrelated open files.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Observed disk events are lost when watched configuration changes are followed by opening or closing the file, leaving cached mappers stale and requiring fixes with regression coverage.
Preserve disk invalidation when opening a watched configuration
tsc/internal/project/overlayfs.go:462
If an external write and watch notification for a cached mapper configuration are immediately followed by didOpen, the open branch discards the disk invalidation. It bypasses the later DiskChanged recording, while the new overlay filter excludes the Changed entry produced by opening the file, leaving the mapper stale. Preserve observed disk events in DiskChanged before processing the open, and add a watch → open regression case.
Record disk changes when closing a saved configuration
tsc/internal/project/overlayfs.go:571
For a save-only client, saving a watched configuration and closing its tab before the next flush still leaves the mapper stale. The close removes the overlay before this check, and no Changed entry is added when the saved disk text matches the previously flushed overlay. Record the observed disk event even when the overlay is being closed, and add a save → close → request regression case.
Fixed in 19cd34b. Disk invalidation now survives watch → open and save → close, with regression coverage for both and save → reopen. npx hereby validate passed. Secret scanning passed; CodeQL analysis was skipped because its database exceeded the size limit.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The changed-file filter drops watched symlink aliases for real-path disk notifications when no overlay exists at the real path, leaving mapper configuration stale.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Preserve disk-change provenance when expanding symlink aliases
When a mapper watches an open symlink alias such as /project/node_modules/pkg/package.json, a watch-only notification at its real path /packages/pkg/package.json leaves DiskChanged empty because no overlay exists at that real path. Alias expansion adds the watched alias to Changed, but this filter removes it, leaving the mapper configuration stale. Preserve disk-event provenance before alias expansion, and add a regression with the overlay at the symlink path and the notification at the real path.
Fixed in 99982aa. Disk-change provenance now survives alias expansion when the overlay is at the symlink path and the watch notification is at the real path. Added a regression verifying the mapper refreshes while unsaved overlay text remains unchanged. npx hereby validate and secret scanning passed. CodeQL analysis was skipped because its database exceeded the size limit.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Human assessment is needed to evaluate the performance impact of large batches of unrelated file changes triggering unnecessary mapper refreshes and project rebuilds.
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
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.
Saving an open
watchedFilesfile could leave content mapper types stale: an earlier edit refreshed configuration from old disk content, while subsequent save/watch notifications were suppressed by the overlay.FileChangeSummary.DiskChangedand include them when refreshing affected mapper projects, without marking overlay source text as changed.watchedFilesfile that is open in the editor never re-runsopenProject(stale types until the language server is restarted) #65084