Skip to content

fix: filter aliased folder types in SDRMetadataAdapter#1222

Merged
scolladon merged 4 commits intomainfrom
fix/filter-aliased-folder-types
Feb 25, 2026
Merged

fix: filter aliased folder types in SDRMetadataAdapter#1222
scolladon merged 4 commits intomainfrom
fix/filter-aliased-folder-types

Conversation

@scolladon
Copy link
Copy Markdown
Owner

Explain your changes

EmailTemplateFolder (id: emailtemplatefolder, aliasFor: "emailfolder") shares directoryName: "email" with EmailTemplate. It passed the folder-type filter in getOrCreateCache() because no type references emailtemplatefolder as a folderType. It overwrote EmailTemplate in the metadataPerDir map, causing email files to silently resolve to the wrong type and be dropped.

Extend getOrCreateCache() to also exclude types whose aliasFor points to a known folder type. The fix is generic — not hardcoded to emailtemplatefolder — so future SDR types with aliasFor pointing to folder types will be handled automatically.

Does this close any currently open issues?


  • Jest tests added to cover the fix.
  • NUT tests added to cover the fix.
  • E2E tests added to cover the fix.

Any particular element that can be tested locally


# Verify EmailTemplate resolves correctly
npx jest __tests__/unit/lib/metadata/sdrMetadataAdapter.test.ts -t "EmailTemplate"

# Run full test suite
npm test

Any other comments


Currently emailtemplatefolder is the only SDR type with aliasFor, but the fix handles any future alias types generically.

EmailTemplateFolder (aliasFor: emailfolder) shares directoryName 'email'
with EmailTemplate, causing it to overwrite EmailTemplate in the
metadataPerDir map and silently drop email template files.

Extend getOrCreateCache() to also exclude types whose aliasFor points
to a known folder type, preventing alias types from polluting the
metadata output.
@scolladon scolladon force-pushed the fix/filter-aliased-folder-types branch from 13f27a1 to 008f53c Compare February 25, 2026 13:00
@github-actions
Copy link
Copy Markdown

Published under dev-1222 npm channel.

$ sf plugins install sf-git-merge-driver@dev-1222

@scolladon scolladon merged commit da6ea2a into main Feb 25, 2026
20 of 22 checks passed
@scolladon scolladon deleted the fix/filter-aliased-folder-types branch February 25, 2026 13:41
@github-actions
Copy link
Copy Markdown

Shipped in release v6.32.3.
Version v6.32.3 will be assigned to the latest npm channel soon
Install it using either v6.32.3 or the latest-rc npm channel

$ sf plugins install sfdx-git-delta@latest-rc
# Or
$ sf plugins install sfdx-git-delta@v6.32.3

💡 Enjoying sfdx-git-delta?
Your contribution helps us provide fast support 🚀 and high quality features 🔥
Become a sponsor 💙
Happy incremental deployment!

@scolladon scolladon mentioned this pull request Mar 2, 2026
1 task
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.

1 participant