Skip to content

Fix incremental diagnostics after global file deletion - #64845

Merged
John Favret (johnfav03) merged 1 commit into
microsoft:mainfrom
johnfav03:fix/64552-incremental-state
Oct 16, 2026
Merged

John Favret (johnfav03) merged 1 commit into
microsoft:mainfrom
johnfav03:fix/64552-incremental-state

Conversation

@johnfav03

Copy link
Copy Markdown
Contributor

Fixes #64552

Incremental snapshot construction stopped after the first deleted file because the native SyncMap.Range callback used the opposite continuation convention from Strada, making global-scope invalidation depend on nondeterministic map iteration order. This means stale diagnostics or obsolete pending state could be persisted when lib or target changes removed multiple files.

Copilot AI balanced review requested due to automatic review settings October 16, 2026 17:34
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Oct 16, 2026
@typescript-automation typescript-automation Bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Oct 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Core incremental-cache and persistence changes need human confirmation of successful regression validation.

0 open findings

What changed in this PR

Addresses #64552 by correcting deleted-file processing in the native compiler’s incremental snapshots, preventing stale diagnostics after lib or target changes.

Changes:

  • Processes every deleted file and removes obsolete pending state.
  • Invalidates affected diagnostics when global scope changes.
  • Adds regression tests and baselines for deletion, diagnostic caching, and build-info persistence.
File Description
tsc/​testdata/​baselines/​reference/​tsc/​incremental/​unchecked-deleted-paths-with-no-emit-composite-true.js Pending-state cleanup with composite enabled.
tsc/​testdata/​baselines/​reference/​tsc/​incremental/​unchecked-deleted-paths-with-no-emit-composite-false.js Pending-state cleanup without composite.
tsc/​testdata/​baselines/​reference/​tsc/​incremental/​retained-library-diagnostics-after-global-deletion-cleared-true.js Library errors cleared after deletion.
tsc/​testdata/​baselines/​reference/​tsc/​incremental/​retained-library-diagnostics-after-global-deletion-cleared-true-with-single-threaded.js Error clearing in single-threaded mode.
tsc/​testdata/​baselines/​reference/​tsc/​incremental/​retained-library-diagnostics-after-global-deletion-cleared-true-with-one-checker.js Error clearing with one checker.
tsc/​testdata/​baselines/​reference/​tsc/​incremental/​retained-library-diagnostics-after-global-deletion-cleared-false.js New library errors after deletion.
tsc/​testdata/​baselines/​reference/​tsc/​incremental/​retained-library-diagnostics-after-global-deletion-cleared-false-with-single-threaded.js New errors in single-threaded mode.
tsc/​testdata/​baselines/​reference/​tsc/​incremental/​retained-library-diagnostics-after-global-deletion-cleared-false-with-one-checker.js New errors with one checker.
tsc/​testdata/​baselines/​reference/​tsc/​incremental/​mixed-file-deletion-with-add-and-change.js Mixed deletion, addition, and modification baseline.
tsc/​internal/​execute/​tsctests/​tsc_test.go Adds incremental CLI regression scenarios.
tsc/​internal/​execute/​incremental/​programtosnapshot.go Corrects deletion handling and cache invalidation.
tsc/​internal/​execute/​incremental/​buildinfo_path_test.go Tests deletion traversal, caching, and persisted state.

🧠 Review effort: Balanced


💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@jakebailey

Copy link
Copy Markdown
Member

I actually think I have a fix for this in #64712 that's broader and fixes all possible variants.

@jakebailey

Copy link
Copy Markdown
Member

Though I think you have some extra good stuff on top, looking harder.

@jakebailey

Copy link
Copy Markdown
Member

Yeah, probably better to take yours and I'll deal with the rebase.

@johnfav03

Copy link
Copy Markdown
Contributor Author

Okay, that sounds good to me; I'll give your PR a review when I get a minute

@github-project-automation github-project-automation Bot moved this from Not started to Needs merge in PR Backlog Oct 16, 2026
@johnfav03
John Favret (johnfav03) added this pull request to the merge queue Oct 16, 2026
Merged via the queue into microsoft:main with commit 0a27bad Oct 16, 2026
29 checks passed
@johnfav03
John Favret (johnfav03) deleted the fix/64552-incremental-state branch October 16, 2026 21:37
@github-project-automation github-project-automation Bot moved this from Needs merge to Done in PR Backlog Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

--incremental keeps stale diagnostics after lib or target changes in tsconfig.json (7.0.2, regression from 6.0.3)

3 participants