Skip to content

Keep the latest debugger source refresh - #347124

Merged
Connor Peet (connor4312) merged 2 commits into
microsoft:mainfrom
sameerihs:keep-latest-debugger-source-refresh
Nov 10, 2026
Merged

Connor Peet (connor4312) merged 2 commits into
microsoft:mainfrom
sameerihs:keep-latest-debugger-source-refresh

Conversation

@sameerihs

Copy link
Copy Markdown
Contributor

Fixes #347123

Overlapping debugger source refreshes can let an older DAP response replace newer source text. Establish request ownership before awaiting the source response, ignore obsolete results and errors, and allow only the current operation to clear its pending entry.

Regression tests cover response ordering, stale errors, minimal-edit completion and disposal. Current errors and initial source creation retain their existing behaviour. Focused tests, client compilation/typechecking and changed-file lint pass.

Validation is at the workbench service level with synthetic adapter and minimal-edit responses. It does not claim a native DAP session or packaged-stable execution.

Copilot AI balanced review requested due to automatic review settings November 9, 2026 18:53

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.

🟢 Approval recommended

No active review issues remain for the change to preserve the latest requested debugger source content during overlapping refreshes.

No open issues 🎉

What changed in this PR

Fixes #347123 by ensuring overlapping debugger source refreshes preserve the latest requested content in VS Code’s debug source models.

Changes:

  • Establishes update ownership before loading source content, ignores stale responses and errors, and restricts pending-entry cleanup to the owning operation.
  • Adds regression coverage for response ordering, delayed minimal edits, disposal, and sequential updates including empty content.

No actionable findings remain. Reported validation uses synthetic workbench-level tests, not a native debug session or packaged release.

File Description
src/​vs/​workbench/​contrib/​debug/​test/​browser/​debugSource.test.ts Adds source-refresh ordering and lifecycle regression tests.
src/​vs/​workbench/​contrib/​debug/​common/​debugContentProvider.ts Guards refresh ownership and cancellation to prevent stale updates.

Review effort: Balanced

@connor4312 Connor Peet (connor4312) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks!

@connor4312
Connor Peet (connor4312) enabled auto-merge (squash) November 9, 2026 22:04
roblourens
roblourens previously approved these changes Nov 9, 2026
@connor4312

Copy link
Copy Markdown
Member

Sameer (@sameerihs) looks like some test failures, will want to normalize crlf

auto-merge was automatically disabled November 10, 2026 07:26

Head branch was pushed to by a user without write access

@sameerihs

Copy link
Copy Markdown
Contributor Author

Thanks, that assertion was assuming LF. Fixed in 82af03c: the test now reads the model with EndOfLinePreference.LF. I reproduced the failure by forcing CRLF on the model, then checked both line endings after the change. All nine source tests and targeted lint pass.

@connor4312
Connor Peet (connor4312) merged commit a4fb6eb into microsoft:main Nov 10, 2026
58 of 76 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.147.0 milestone Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

7 participants