-
Notifications
You must be signed in to change notification settings - Fork 12
fix: download site bundle correctly if site name has special chars #232
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
Conversation
Thanks for the contribution! Unfortunately we can't verify the commit author(s): pulkit.jain <p***@s***.com>. One possible solution is to add that email to your GitHub account. Alternatively you can change your commits to another email and force push the change. After getting your commits associated with your GitHub account, refresh the status of this Pull Request. |
const result = await this.org | ||
.getConnection() | ||
.query<{ Name: string; LastModifiedDate: string }>( | ||
`SELECT Name, LastModifiedDate FROM StaticResource WHERE Name LIKE 'MRT_experience_%_${this.siteName}'` | ||
); | ||
// Changing the site name back to original after fetching data from StaticResource so it may not break the flow elsewhere | ||
// this.siteName = originalSiteName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nrkruk If we uncomment this, it breaks the flow when we try to bring the site up in some cases where site name have special chars other than "-"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what this means. Does this impact functionality in some way? If we don't set this what happens?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nrkruk I was resetting the site name back to original after executing the query but when it tries to bring up the site it fails. So, basically we will get that site bundle but it won't bring up the site.
Also, should we do the site name updation inside the constructor itself? It's already replacing the space with underscore character.
public constructor(org: Org, siteName: string) {
this.org = org;
this.siteDisplayName = siteName.trim();
this.siteName = this.siteDisplayName.replace(' ', '_');
}
|
||
export function replaceSpacesAndSpecialChars(value: string): string { | ||
// Replace any special characters with underscore | ||
value = value.replace(/[^a-zA-Z0-9]/g, '_'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so all special characters are always replaced with underscore? (I haven't tested this, but I assume you have)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tested with below examples of site names, works fine.
- space separated site
- site@with#special-chars
- site-with-hyphen
- byoNoBasePath
- byo enhanced
We will also need to backport this to the 252-patch branch |
Closing this forked repo PR. Will create a new one. |
What does this PR do?
Fixes the bug when site name contains special chars and we need to download site bundle
What issues does this PR fix or reference?
@W-16552899@