Skip to content

fix: metadata with ampersand (%26) never syncs in source tracking @W-21360609@#862

Open
WillieRuemmele wants to merge 3 commits into
mainfrom
wr/fixAmpersandSourceTracking
Open

fix: metadata with ampersand (%26) never syncs in source tracking @W-21360609@#862
WillieRuemmele wants to merge 3 commits into
mainfrom
wr/fixAmpersandSourceTracking

Conversation

@WillieRuemmele

Copy link
Copy Markdown
Member

Summary

  • syncSpecifiedElements() used decodeURI() as fallback when matching metadata keys, but decodeURI does not decode %26 (ampersand) — only decodeURIComponent does
  • This caused metadata files with & in their names (stored as %26 on disk) to never have lastRetrievedFromServer updated, making them perpetually appear as needing retrieve
  • Fix: replace the raw decodeURI fallback with the existing getSourceMember() private method which already handles all encoded characters properly via getDecodedKeyIfSourceMembersHas()

Fixes forcedotcom/cli#3504

Work Item

@W-21360609@: CLI: Metadata files with ampersand don't get properly updated in source tracking

Proof of Work

  • Tests: 26 passing (including new ampersand-specific test)
  • Lint: clean (only pre-existing header/license issues on main)
  • Type check: clean (only pre-existing isomorphic-git ESM issues on main)

Test plan

  • Verify that a Layout with & in the name (e.g. "Legal & Compliance Layout") syncs correctly after retrieve
  • Verify that sf project retrieve preview no longer shows the file as needing retrieve after a successful pull
  • Verify existing %2E (dot) encoding cases still work (covered by existing tests)
  • Verify .forceignore correctly ignores files with encoded special characters

…dElements @W-21360609@

syncSpecifiedElements used decodeURI() as fallback when matching
metadata keys, but decodeURI does not decode %26 (ampersand).
This caused metadata files with & in their names (stored as %26 on
disk) to never have lastRetrievedFromServer updated, making them
perpetually appear as needing retrieve.

Replace the raw decodeURI fallback with the existing getSourceMember()
method which properly handles all encoded characters via
decodeURIComponent.
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.

Metadata files with ampersand don't get properly updated in source tracking

1 participant