Skip to content

Conversation

@alexr00
Copy link
Member

@alexr00 alexr00 commented Dec 3, 2025

Copilot AI review requested due to automatic review settings December 3, 2025 16:49
@alexr00 alexr00 enabled auto-merge (squash) December 3, 2025 16:49
@alexr00 alexr00 self-assigned this Dec 3, 2025
@vs-code-engineering vs-code-engineering bot added this to the November 2025 milestone Dec 3, 2025
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 PR fixes issue microsoft/vscode-pull-request-github#8073 where concurrent tree view operations could throw an "Element with id X is already registered" error. The fix handles the case where the same element (same object reference) is being registered multiple times concurrently by updating the existing node instead of throwing an error.

Key changes:

  • Modified _createAndRegisterTreeNode to detect when an element with the same ID is being re-registered
  • If the element is the same object, update the existing node instead of throwing an error
  • If the element is a different object with the same ID, still throw the error (correct behavior)
  • Added comprehensive test for concurrent reveal operations

Reviewed changes

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

File Description
src/vs/workbench/api/common/extHostTreeViews.ts Modified _createAndRegisterTreeNode method to handle concurrent registration of the same element by updating the existing node instead of throwing an error
extensions/vscode-api-tests/src/singlefolder-tests/tree.test.ts Added new test suite with a test case that verifies concurrent reveal operations on the same element don't throw the "already registered" error

@alexr00 alexr00 disabled auto-merge December 3, 2025 17:07
@alexr00 alexr00 enabled auto-merge (squash) December 3, 2025 17:09
@alexr00 alexr00 merged commit ca3f221 into main Dec 3, 2025
33 of 34 checks passed
@alexr00 alexr00 deleted the alexr00/disastrous-vicuna branch December 3, 2025 17:59
alexr00 added a commit that referenced this pull request Dec 4, 2025
alexr00 added a commit that referenced this pull request Dec 4, 2025
* Revert "Fix element already registered (#281000)"

This reverts commit ca3f221.

* skip test
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Jan 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Element with id All Open (URL) is already registered

3 participants