make caching more robust; fixes #69534 #70073
Merged
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.
This PR fixes #69534.
When talking to the EH I was sending the debug session data only once in the first request that needed it. Then EH cached the data.
For subsequent request I'm sending only the session ID (and the EH looks up the session object from the cache). VS Code made the decision whether to send the full data or just the ID base on a "Set" data structure: after sending the data once, the ID is added to the Set.
After "workspaceService.resolveWorkspaceFolder()" had become asynchronous, the timing behavior has changed and now the EH cache does not have the data when a session ID arrives and needs to be looked up. This results in a "null" session and the error message on the console.
The fix is to introduce a robust (but still synchronous) caching protocol. For this the EH sends a new request "sessionCached" back to VS Code when it has cached the data. And VS Code only stops sending the full data if it has received the "sessionCached" request.