Handle unloaded projects in API snapshot responses#4483
Open
ulitink wants to merge 2 commits into
Open
Conversation
Author
|
@microsoft-github-policy-service agree company="JetBrains" |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses a panic in the API updateSnapshot response serialization path when a snapshot contains an “unloaded” configured project whose CommandLine is nil (e.g., an ancestor tsconfig discovered during solution search).
Changes:
- Add a regression test covering serialization of a snapshot that includes both a loaded nested configured project and an unloaded ancestor configured project.
- Update
NewProjectResponseto avoid dereferencingp.CommandLinewhen it is nil.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| internal/api/proto.go | Adds a nil guard in NewProjectResponse to prevent panics when serializing projects without a command line. |
| internal/api/session_apistate_test.go | Adds a regression test that exercises updateSnapshot when an unloaded ancestor configured project is present. |
andrewbranch
requested changes
Jun 30, 2026
andrewbranch
left a comment
Member
There was a problem hiding this comment.
Can we just filter these stub projects out of the API response instead?
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.
Opening a file can load its nearest configured project while solution search discovers an ancestor tsconfig as an unloaded placeholder. API
updateSnapshotpreviously serialized every project assumingCommandLinewas non-nil, which couldp anic for that unloaded ancestor project.