Repository navigation
[api] Leave a config out of its own extended source files - #64755
Open
Christopher Plieger (cplieger) wants to merge 1 commit into
Open
Christopher Plieger (cplieger) wants to merge 1 commit into
Christopher Plieger (cplieger) wants to merge 1 commit into
Conversation
Copilot started reviewing on behalf of
Christopher Plieger (cplieger)
October 12, 2026 22:01
View session
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused fix preserves other extended dependencies and the regression test covers the reported cached-chain deadlock.
0 open findings
What changed in this PR
Prevents API snapshot deadlocks when a configuration’s extends chain is circular.
Changes:
- Excludes a config’s own canonical path from
ExtendedSourceFiles. - Adds an API regression test covering cached circular
extendschains and TS18000.
| File | Description |
|---|---|
tsc/internal/tsoptions/tsconfigparsing.go |
Filters self-references from extended config dependencies. |
tsc/internal/api/session_apistate_test.go |
Verifies snapshot creation completes and reports circularity. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
| codes = append(codes, diagnostic.Code) | ||
| } | ||
| assert.DeepEqual(t, codes, []int32{18000}) | ||
| case <-time.After(10 * time.Second): |
There was a problem hiding this comment.
There's no reason to do this in a test, since the test would just exit on the global timeout, no? Or maybe just use synctest if you want to drive it?
This branch has not been deployed
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.
When an opened config's
extendschain cycles back to it,parseConfiglists the config in its ownExtendedSourceFiles. It gets there through the edge that closes the cycle, or through a cached extended config whose list was built while another project was opened. The project registry walks that list inupdateExtendingConfigswhile it holds the config's own entry lock, soLoadOrStorewaits on that lock andcreateSnapshotnever returns.Impact: one circular
extendsin a repository makescreateSnapshothang with no error, wheretsc -preports TS18000 and exits 2 at once, so an analyzer on the API stalls on that repository instead of reporting what is wrong with it.parseConfignow skips the config's own path when it assemblesExtendedSourceFiles, compared byPathKeyas the circularity check does. Every other config in the chain stays in the list, so watching and cache invalidation see the same dependencies, and TS18000 is reported as before. Strada also lists the config in this case, but nothing there walks the list under that config's lock.TestOpenProjectsWithCircularExtendsReportCircularityopensp1and thenp2in one session. Both extendshared/base.json, which extendsp2, sop2reaches itself through the edge that closes the cycle and through thebase.jsonentry cached whilep1was opened. It expects TS18000 as the only config file parsing diagnostic ofp2, and onmainit times out after 10 seconds on each of 20 runs. With atscbuilt from this branch, the reproduction in the issue returns and reports TS18000.TS18000 still prints its
{0}placeholder unfilled, which has a separate cause and is left out of this change.I met this while building deadset-ts, the TypeScript analyzer of deadset, on the TypeScript 7 API. That work hit a small set of related defects, which is why a few reports come from me.
An AI coding agent wrote this patch. I have read, built and tested it and will handle the review.
Backlogmilestone (required)mainbranchnpx hereby testnpx hereby lintnpx hereby check:formatFixes #64754