Skip to content

Commit

Permalink
fix: use decodeURIComponent() rather than decodeURI()
Browse files Browse the repository at this point in the history
  • Loading branch information
shetzel committed Aug 11, 2023
1 parent f5eb155 commit 2d42c6f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/shared/populateFilePaths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const populateFilePaths = (elements: ChangeResult[], packageDirPaths: str
);
// Decode the key since local components can have encoded fullNames, but results from querying
// SourceMembers have fullNames that are not encoded. See: https://github.com/forcedotcom/cli/issues/1683
const key = decodeURI(getMetadataKey(matchingComponent.type.name, matchingComponent.fullName));
const key = decodeURIComponent(getMetadataKey(matchingComponent.type.name, matchingComponent.fullName));
elementMap.set(key, {
...elementMap.get(key),
modified: true,
Expand Down
4 changes: 2 additions & 2 deletions src/shared/remoteSourceTrackingService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -610,8 +610,8 @@ function getDecodedKeyIfSourceMembersHas({
key: string;
logger: Logger;
}): string {
const originalKeyDecoded = decodeURI(key);
const match = Object.keys(sourceMembers).find((memberKey) => decodeURI(memberKey) === originalKeyDecoded);
const originalKeyDecoded = decodeURIComponent(key);
const match = Object.keys(sourceMembers).find((memberKey) => decodeURIComponent(memberKey) === originalKeyDecoded);
if (match) {
logger.debug(`${match} matches already tracked member: ${key}`);
return match;
Expand Down

0 comments on commit 2d42c6f

Please sign in to comment.