Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: decode filepaths when comparing to the RSST for accurate results #421

Merged
merged 4 commits into from
Jun 26, 2023

Conversation

WillieRuemmele
Copy link
Member

What does this PR do?

allows filepaths to be URI decoded when comparing to what's in the RSST to prevent special characters from breaking source tracking

What issues does this PR fix or reference?

@W-13593791@
forcedotcom/cli#2212

@@ -196,7 +199,7 @@ export class RemoteSourceTrackingService extends ConfigFile<RemoteSourceTracking
// any item in an aura/LWC bundle needs to represent the top (bundle) level and the file itself
// so we de-dupe via a set
Array.from(new Set(elements.flatMap((element) => getMetadataKeyFromFileResponse(element)))).map((metadataKey) => {
const revision = revisions[metadataKey];
const revision = revisions[decodeURI(metadataKey)];
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the real change, the other changes are just about ordering in the file after removing the eslint rule

Copy link
Contributor

@mshanemc mshanemc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no changes required

@@ -127,7 +124,13 @@ export class RemoteSourceTrackingService extends ConfigFile<RemoteSourceTracking
}
return path.isAbsolute(fileToDelete) ? fileToDelete : path.join(process.cwd(), fileToDelete);
}

private static convertRevisionToChange(memberKey: string, memberRevision: MemberRevision): RemoteChangeElement {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like a function to me.

@mshanemc
Copy link
Contributor

QA: used PDR. (had to remove Profiles from .forceignore)

manual create profile named test (with parens)
see unencoded name in the project retrieve preview
project retrieve start
✅ retrieves, stores as an encoded filename (which it does without this change)
project retrieve preview no longer sees the change


I'm going to merge all the other dependency PRs into this, and also modify the code to check for both encoded and non-encoded key matches.

@mshanemc mshanemc merged commit 59c2d56 into main Jun 26, 2023
@mshanemc mshanemc deleted the wr/remoteChangesWithSpecialChars branch June 26, 2023 14:44
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.

2 participants