-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[$1000] Inconsistent autolink parsing on parameter with styling characters (underscores and tildes) #18564
Comments
Triggered auto assignment to @NicMendonca ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalPlease re-state the problem that we are trying to solve in this issue.We want to allow the tilde What is the root cause of that problem?We are not allowing tilde const URL_PARAM_REGEX = `(?:\\?${addEscapedChar('[-\\w$@.+!*()\\/,=%{}:;\\[\\]\\|_]')}*)?`; What changes do you think we should make in order to solve the problem?We need to updated regex to allow const URL_PARAM_REGEX = `(?:\\?${addEscapedChar('[-\\w$@.+!*()\\/,=%{}:;\\[\\]\\|_|~]')}*)?`; Optional: I suggest we also allow
For this we need update the url param regex to allow
const URL_PROTOCOL_REGEX = '((ht|f)tps?:[\\/|\\\\][\\/|\\\\])'; // [\\/|\\\\]{2} would also work in place of [\\/|\\\\][\\/|\\\\]
const URL_WEBSITE_REGEX = `${URL_PROTOCOL_REGEX}?((?:www\\.)?[a-z0-9](?:[-a-z0-9]*[a-z0-9])?\\.)+(?:${TLD_REGEX})(?:\\:${ALLOWED_PORTS}|\\b|(?=_))`; const URL_PATH_REGEX = `(?:${addEscapedChar('[.,=(+$!*]')}?[\\/|\\\\]${addEscapedChar('[-\\w$@.+!*:(),=%~]')}*${addEscapedChar('[-\\w~@:%)]')}|\\/|\\\\)*`;
const URL_PARAM_REGEX = `(?:\\?${addEscapedChar('[-\\w$@.+!*()\\/,=%{}:;\\[\\]\\|_|~|\\\\]')}*)?`; What alternative solutions did you explore? (Optional)N/A |
Wow, TIL |
Job added to Upwork: https://www.upwork.com/jobs/~01cb4a801e2a4e7612 |
Current assignee @NicMendonca is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane ( |
Triggered auto assignment to @PauloGasparSv ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Underscores and tildes are parsed differently though they are valid URI characters. What is the root cause of that problem?The main cause of this issue is in its query regex below.
What changes do you think we should make in order to solve the problem?We need to update the param regex. Also
What alternative solutions did you explore? (Optional)
|
Thanks for the proposals. Proposal from @huzaifa-99 looks good to me. I don't think any optional change will be required here. 🎀👀🎀 C+ reviewed cc: @PauloGasparSv |
📣 @huzaifa-99 You have been assigned to this job by @PauloGasparSv! |
LGTM to me too so I've assigned @huzaifa-99 here. Btw, I think we should implement those optional changes + test to see if they cause any regressions. |
Thanks for the proposal review @sobitneupane, @PauloGasparSv. pull/533 up for review in expensify-common. I have also added the optional changes as @PauloGasparSv suggested |
The P.R. was merged succesfully. Since these changes were done to Expensify-common we still have to update that lib version in NewDot. Someone else already created this P.R. which includes our changes. I'll ask them to add our Test and QA steps there |
Changes are in production! I think we are good to close this. ![]() @NicMendonca can you help with payment and closing this issue? |
@PauloGasparSv weird, I am not sure why the |
Going OOO until June 5th so assigning a buddy to issue payment |
Triggered auto assignment to @kevinksullivan ( |
This comment was marked as duplicate.
This comment was marked as duplicate.
@PauloGasparSv Is this eligible for a quick merge bonus? Asking since I only created the expensify-common/pull/533 but the App/pull/18994 that introduced those changes in Expensify/App was done by someone else, tho their work was unrelated but it pulled the latest changes from expensify-common. |
I think the compensation will only be based on when Expensify/expensify-common#533 was merged and not #18994 since that comes from another contributor : ) |
@kerupuksambel @huzaifa-99 @sobitneupane offers sent. Let me know when you accept. Thanks! |
@kevinksullivan offer accepted, thanks! |
Accepted @kevinksullivan. Also is this eligible for a quick merge bonus, the pr got merged in 5 days including weekend (-2 days) ? |
Correct @huzaifa-99 |
Paid out! |
@huzaifa-99 upwork is being buggy and not letting my close the contract. Stay tuned on that. |
Thanks for the heads up @kevinksullivan. |
All set @huzaifa-99 ! |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
Expected Result :
Since tilde is a valid URL character and treated as unreserved characters, just like underscore (https://datatracker.ietf.org/doc/html/rfc3986#section-2.3), parameters with tildes should be treated the same as parameter with underscores, hence tilde should be included in the URL
Actual Result :
While URL parameter with underscore parsed correctly and included in the autolink, URL parameter with tildes parsed separatedly and the parameter isn't included in the autolink
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.11.2
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Tilde.Autolink.mp4
Expensify/Expensify Issue URL:
Issue reported by: @kerupuksambel
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1683422758747299
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: