Skip to content

fix(org-browser): deduplicate metadata list results to prevent tree registration errors#7321

Open
CristiCanizales wants to merge 1 commit into
developfrom
cristi/deduplicate-metadata-list-7212
Open

fix(org-browser): deduplicate metadata list results to prevent tree registration errors#7321
CristiCanizales wants to merge 1 commit into
developfrom
cristi/deduplicate-metadata-list-7212

Conversation

@CristiCanizales
Copy link
Copy Markdown
Contributor

Summary

  • Adds deduplication to performListMetadata in metadataDescribeService.ts to handle the Metadata API returning duplicate FileProperties for the same component
  • This prevents the Org Browser TreeView from crashing with "Element with id CustomObject:Account is already registered"
  • Root cause is a Metadata API bug that returns duplicate entries (confirmed in orgs with Person Account enabled); support cases have been filed

Fixes #7212

Test plan

  • Connect to an org with Person Account enabled (which causes duplicate Account in sf org list metadata --metadata-type CustomObject)
  • Open the Org Browser and expand Custom Objects
  • Verify no "already registered" error appears and Account shows up once
  • Verify other metadata types still load correctly

🤖 Generated with Claude Code

…egistration errors

The Metadata API can return duplicate FileProperties for the same component
(e.g. Account appearing twice in orgs with Person Account enabled). This causes
the Org Browser TreeView to crash with "Element with id CustomObject:Account is
already registered". Deduplicate after sorting since duplicates are adjacent.

Fixes #7212

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@CristiCanizales CristiCanizales requested a review from a team as a code owner May 14, 2026 13:12
@CristiCanizales CristiCanizales self-assigned this May 14, 2026
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.

SFDX Metadata Cursor: Element with id CustomObject:Account is already registered

1 participant