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
[$250] Incorrect parsing for backticks with a space in between them #48101
Version Number: Reproducible in staging?: yes Reproducible in production?: yes 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 Expensify/Expensify Issue URL: Issue reported by: Slack conversation: not Slack but #46917 (comment)
Action Performed:
Send the following input:
it uses`;`separated fields because the line number column could have`:`in them ` ` with space
Expected Result:
The input should look like
it uses;separated fields because the line number column could have:in them with space
(The space at the end is in a code block)
Actual Result:
The input looks like
(The space at the end is not in a code block, the backticks are visible)
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Yes
Platforms:
Which of our officially supported platforms is this issue occurring on?
The parsing is actually wonkier than this on staging/prod so this bug isn't visible yet, but it will be when THAT parsing is fixed by #47838. Making this so I don't forget, but no action at the moment @muttmuure!
📣 @c0ffincolors! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
We also need to escape the space character as due to the issue #8720, which is addressed by Expensify/expensify-common#443. Sending an unescaped space or a space-only inlinecode or code block, results in a server error response.
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
Activity
melvin-bot commentedon Aug 27, 2024
Triggered auto assignment to @muttmuure (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.dangrous commentedon Aug 27, 2024
The parsing is actually wonkier than this on staging/prod so this bug isn't visible yet, but it will be when THAT parsing is fixed by #47838. Making this so I don't forget, but no action at the moment @muttmuure!
melvin-bot commentedon Aug 27, 2024
📣 @c0ffincolors! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Format:
Nodebrute commentedon Aug 27, 2024
Edited by proposal-police: This proposal was edited at 2024-08-27 16:19:13 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Incorrect parsing for backticks with a space in between them
What is the root cause of that problem?
We are checking that there is at least one whitespace character
https://github.com/Expensify/expensify-common/blob/d11466167bc562447d2dfdad624145040153efae/lib/ExpensiMark.ts#L193
What changes do you think we should make in order to solve the problem?
Remove
\S+?from this regexhttps://github.com/Expensify/expensify-common/blob/d11466167bc562447d2dfdad624145040153efae/lib/ExpensiMark.ts#L193
Updated regex
Result:

Or
What alternative solutions did you explore? (Optional)
tsa321 commentedon Aug 28, 2024
Edited by proposal-police: This proposal was edited at 2024-08-28 11:10:18 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Incorrect parsing for backticks with a space in between them
What is the root cause of that problem?
The regex for inline code:
https://github.com/Expensify/expensify-common/blob/d11466167bc562447d2dfdad624145040153efae/lib/ExpensiMark.ts#L193
that will be modified into :
/(\B|_|)`((?:`)*)(?!`)(.*?\S+?.*?)(?<!`)((?:`)*)(`)(\B|_|)(?!`|[^<]*<\/pre>|[^<]*<\/video>)/gmwon't allow space only inside backtick, in the
(.*?\S+?.*?)partWhat changes do you think we should make in order to solve the problem?
Modify the regex into:
/(\B|_|)`((?:`)*)(?!`)(.+?)(?<!`)((?:`)*)(`)(\B|_|)(?!`|[^<]*<\/pre>|[^<]*<\/video>)/gmWe also need to escape the space character as
due to the issue #8720, which is addressed by Expensify/expensify-common#443. Sending an unescaped space or a space-only inlinecode or code block, results in a server error response.We should add
' ' : ' 'in:lib/utils.ts#L13
Additionally, in:
lib/utils.ts#L33
we add
' ': ' 'And in:
lib/utils.ts#L43
we add
|nbsp|but this will breaks many regexes. We could adjust the regexes accordingly.
Alternatively, we could escape the space in before return of
replacefunction of ExpensiMark:https://github.com/Expensify/expensify-common/blob/331f53580a4ddd7f1c8e73c7c1494d0bb22962c7/lib/ExpensiMark.ts#L855
Or right before sending the comment:
App/src/libs/actions/Report.ts
Line 455 in ac5ee2e
and in here:
App/src/libs/actions/Report.ts
Line 468 in ac5ee2e
or directly in here:
App/src/libs/actions/Report.ts
Line 511 in ac5ee2e
Or another more appropriate place.
dangrous commentedon Aug 30, 2024
almost ready to open this up officially, PR is merged but not yet deployed
melvin-bot commentedon Aug 30, 2024
@muttmuure Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
muttmuure commentedon Sep 1, 2024
Will wait until we need an external contributor
muttmuure commentedon Sep 3, 2024
Not overdue
dangrous commentedon Sep 3, 2024
Okay we're ready to go on this one, will make it external
38 remaining items
melvin-bot commentedon Oct 8, 2024
Triggered auto assignment to @anmurali (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.melvin-bot commentedon Oct 15, 2024
@deetergp, @hoangzinh, @anmurali, @tsa321 Whoops! This issue is 2 days overdue. Let's get this updated quick!
hoangzinh commentedon Oct 16, 2024
BugZero Checklist:
hoangzinh commentedon Oct 16, 2024
not overdue, it's ready for payment cc @anmurali
melvin-bot commentedon Oct 23, 2024
@deetergp, @hoangzinh, @anmurali, @tsa321 Whoops! This issue is 2 days overdue. Let's get this updated quick!
hoangzinh commentedon Oct 24, 2024
cc @anmurali on payment
melvin-bot commentedon Oct 31, 2024
@deetergp, @hoangzinh, @anmurali, @tsa321 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
hoangzinh commentedon Nov 1, 2024
Ping in Slack https://expensify.slack.com/archives/C01GTK53T8Q/p1730457342555099
anmurali commentedon Nov 5, 2024
Paid.