Skip to content

Fix quick dispose/reregister of tree view#295996

Merged
alexr00 merged 1 commit intomainfrom
alexr00/early-bass
Feb 18, 2026
Merged

Fix quick dispose/reregister of tree view#295996
alexr00 merged 1 commit intomainfrom
alexr00/early-bass

Conversation

@alexr00
Copy link
Member

@alexr00 alexr00 commented Feb 18, 2026

No description provided.

Copilot AI review requested due to automatic review settings February 18, 2026 12:03
@alexr00 alexr00 enabled auto-merge (squash) February 18, 2026 12:03
@alexr00 alexr00 self-assigned this Feb 18, 2026
@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Feb 18, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request fixes a race condition that occurs when a tree view is quickly disposed and re-registered with the same ID. The async dispose operation could interfere with a newly registered tree view, causing the new view to be incorrectly disposed or preventing it from functioning properly.

Changes:

  • Added identity check in dispose logic to prevent disposing a replacement tree view
  • Moved $disposeTree call from ExtHostTreeView.dispose() to the wrapper dispose function
  • Added comprehensive test to verify the fix

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/vs/workbench/api/common/extHostTreeViews.ts Added check to only dispose tree view if it hasn't been replaced; moved $disposeTree call from internal class to wrapper
src/vs/workbench/api/test/browser/extHostTreeViews.test.ts Added test case verifying dispose/re-register behavior works correctly

@alexr00 alexr00 merged commit 9196123 into main Feb 18, 2026
24 checks passed
@alexr00 alexr00 deleted the alexr00/early-bass branch February 18, 2026 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments