You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2023-10-09] [$1000] Chat - If url ends with slash, then ending double quote is shown as link #24367
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributor
Please re-state the problem that we are trying to solve in this issue.
When users input URLs in the chat application that end with a slash and then immediately close with a double quote, the application incorrectly includes the double quote as part of the URL link.
What is the root cause of that problem?
The root cause of this problem lies in the regex pattern used to detect URLs in the chat text. Specifically, the pattern in URL_PATH_REGEX does not exclude a trailing double quote " after a slash /, leading to incorrect URL detection.
What changes do you think we should make in order to solve the problem?
To resolve this issue, we need to modify the URL_PATH_REGEX regex pattern in Url.js file to ensure it doesn't consider a trailing double quote as part of the URL. This can be achieved by adding a negative lookahead (?!") to the end of the regex pattern. The adjusted URL_PATH_REGEX is as follows:
changed the title [-]Chat - If url ends with slash, then ending double quote is shown as link[/-][+][$1000] Chat - If url ends with slash, then ending double quote is shown as link[/+]on Aug 11, 2023
Please re-state the problem that we are trying to solve in this issue.
When users input URLs in the chat application that end with a slash and then immediately close with a double quote, the application incorrectly includes the double quote as part of the URL link.
What is the root cause of that problem?
the common lib parse links is not perfect, while it is very good enough, It does parse correct many url links with its regex rule
What changes do you think we should make in order to solve the problem?
The other proposal is a right way to go, remove the "addEscapedChar" function will resolve the issue to some extent, however, it is still not perfect, the follow image shows the result by remove escape function.
It is a little hard to get the same result as slack shows, stop at '"', and not others.
What alternative solutions did you explore? (Optional)
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.75-12 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2023-10-09. 🎊
After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
External issue reporter
Contributor that fixed the issue
Contributor+ that helped on the issue and/or PR
For reference, here are some details about the assignees on this issue:
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
[@situchan] The PR that introduced the bug has been identified. Link to the PR:
[@situchan] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
[@situchan] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
[@situchan] Determine if we should create a regression test for this bug.
[@situchan] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
[@greg-schroeder] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
The PR that introduced the bug has been identified. Link to the PR: N/A
The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment: N/A
A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: N/A
Determine if we should create a regression test for this bug.
If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
Automation test cases should cover regression test
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributor
Activity
melvin-bot commentedon Aug 10, 2023
Triggered auto assignment to @greg-schroeder (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Aug 10, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)rayane-d commentedon Aug 10, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
When users input URLs in the chat application that end with a slash and then immediately close with a double quote, the application incorrectly includes the double quote as part of the URL link.
What is the root cause of that problem?
The root cause of this problem lies in the regex pattern used to detect URLs in the chat text. Specifically, the pattern in URL_PATH_REGEX does not exclude a trailing double quote " after a slash /, leading to incorrect URL detection.
What changes do you think we should make in order to solve the problem?
To resolve this issue, we need to modify the URL_PATH_REGEX regex pattern in Url.js file to ensure it doesn't consider a trailing double quote as part of the URL. This can be achieved by adding a negative lookahead (?!") to the end of the regex pattern. The adjusted URL_PATH_REGEX is as follows:
What alternative solutions did you explore? (Optional)
greg-schroeder commentedon Aug 11, 2023
@lanitochka17 can you clarify which platforms this occurs on?
[-]Chat - If url ends with slash, then ending double quote is shown as link[/-][+][$1000] Chat - If url ends with slash, then ending double quote is shown as link[/+]melvin-bot commentedon Aug 11, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01a579e05c4814caf9
melvin-bot commentedon Aug 11, 2023
Current assignee @greg-schroeder is eligible for the External assigner, not assigning anyone new.
melvin-bot commentedon Aug 11, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @parasharrajat (
External)gzqyl commentedon Aug 12, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
When users input URLs in the chat application that end with a slash and then immediately close with a double quote, the application incorrectly includes the double quote as part of the URL link.
What is the root cause of that problem?
the common lib parse links is not perfect, while it is very good enough, It does parse correct many url links with its regex rule
What changes do you think we should make in order to solve the problem?
The other proposal is a right way to go, remove the "addEscapedChar" function will resolve the issue to some extent, however, it is still not perfect, the follow image shows the result by remove escape function.

It is a little hard to get the same result as slack shows, stop at '"', and not others.
What alternative solutions did you explore? (Optional)
N/A
81 remaining items
melvin-bot commentedon Oct 2, 2023
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.75-12 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2023-10-09. 🎊
After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
For reference, here are some details about the assignees on this issue:
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
melvin-bot commentedon Oct 2, 2023
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
greg-schroeder commentedon Oct 11, 2023
Sorry for delay, was OOO. Processing today.
situchan commentedon Oct 11, 2023
Automation test cases should cover regression test
greg-schroeder commentedon Oct 12, 2023
Payment summary:
Contributor: @Antasel $1000
C+: @situchan $1000
Paid out @agilejune fyi
situchan commentedon Oct 12, 2023
@greg-schroeder can you please check #24367 (comment)?
greg-schroeder commentedon Oct 12, 2023
will fire regression test using automation steps
greg-schroeder commentedon Oct 12, 2023
oh yes @situchan sorry, forgot. will do now - done