Repository navigation
fix: prevent DisposableStore leak per tree node in ExtHostTreeView (#346620) - #346727
Merged
Alex Ross (alexr00) merged 4 commits intoNov 12, 2026
Conversation
…icrosoft#346620) ExtHostTreeView registered each tree node's new DisposableStore into the tree view's own DisposableStore via this._register(). Disposing a node disposed that inner store, but never removed it from the view's _toDispose Set, leading to continuous growth on every refresh until V8's maximum Set size (2^24) was exceeded with RangeError: Set maximum size exceeded. Each TreeNode already owns its disposableStore and disposes it via node.dispose() on refresh, clear, and view disposal. Do not register per-node disposableStores into the view's lifetime store.
Contributor
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
2 open issues
Review effort: Lite
Copilot stopped reviewing on behalf of
Alex Ross (alexr00) due to an error
November 11, 2026 16:15
…ilure Dispose the newly allocated DisposableStore in _createTreeNode if an error is thrown before TreeNode ownership is handed off, and update regression test to compare store size against post-first-fetch count across repeated refreshes. Addresses Copilot review feedback on microsoft#346727.
Contributor
Author
|
Addressed review feedback in commit
All 37 unit tests in |
Alex Ross (alexr00)
enabled auto-merge (squash)
November 12, 2026 10:17
Alex Ross (alexr00)
approved these changes
Nov 12, 2026
Ladislau Szomoru (lszomoru)
approved these changes
Nov 12, 2026
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.

Resolves #346620
Summary
In
src/vs/workbench/api/common/extHostTreeViews.ts,_createTreeNode()previously registered each tree node's newDisposableStoreinto the tree view's ownDisposableStoreviathis._register(new DisposableStore()).When a node was disposed (via
_refreshNode(),_clearNodes(), or_createAndRegisterTreeNode()),existing.dispose()calleddisposableStore.dispose(), but never removed theDisposableStoreinstance fromthis._toDisposeinside the tree view's store. As a result, the view's internalSetgrew on every refresh indefinitely until V8's maximumSetlimit (2^24 entries) was reached, throwingRangeError: Set maximum size exceededongetChildren.Changes
ExtHostTreeView._createTreeNode(): instantiatenew DisposableStore()directly rather than registering it into the tree view's own store (this._store). EachTreeNodealready tracks and disposes itsdisposableStorevia its owndispose()method during node refreshes, replacements, node clearing (_clearNodes()), and overall view disposal (_clearAll()).ExtHostTreeView.dispose(): invokethis._clearAll()beforesuper.dispose()to ensure all tree node resources and command caches are released cleanly prior to disposing view event listeners.src/vs/workbench/api/test/browser/extHostTreeViews.test.tsverifying that repeated node fetches and refreshes do not grow the tree view'sDisposableStore.