Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/vs/workbench/contrib/browserView/common/browserView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,9 @@ export class BrowserViewModel extends Disposable implements IBrowserViewModel {

async setVisible(visible: boolean): Promise<void> {
this._visible = visible; // Set optimistically so model is in sync immediately
if (this._store.isDisposed) {
return;
}
Comment on lines 441 to +444
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

setVisible updates the model state (this._visible = visible) before checking this._store.isDisposed. If setVisible is invoked after disposal, this still mutates the model even though the service call is skipped, which can leave observers with an inconsistent visible value. Consider returning early before changing _visible, or otherwise ensure disposed instances cannot be observed/used after disposal (e.g. clear listeners / avoid calling setVisible on disposed models).

Suggested change
this._visible = visible; // Set optimistically so model is in sync immediately
if (this._store.isDisposed) {
return;
}
if (this._store.isDisposed) {
return;
}
this._visible = visible; // Set optimistically so model is in sync immediately

Copilot uses AI. Check for mistakes.
return this.browserViewService.setVisible(this.id, visible);
}

Expand Down
Loading