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-11-06] [$500] Chat - Email pattern is not recognized when sending a comment #28629
changed the title [-]Chat - Email pattern is not recognized when sending a comment[/-][+][$500] Chat - Email pattern is not recognized when sending a comment[/+]on Oct 2, 2023
I suggest to replace <\\/(?!em) with <\\/(?!em|code|pre).
In other words, replace (?![^<]*>|[^<>]*<\\/(?!em)) with (?![^<]*>|[^<>]*<\\/(?!em|code|pre)).
Previous autoEmail regex blocks replacement if the comment contains any closing tag just before email, except </em> tag.
But the updated regex will allow replacement if the comment contains </em>, </pre>, </code> tag just before email.
changed the title [-][$500] Chat - Email pattern is not recognized when sending a comment[/-][+][HOLD for payment 2023-11-06] [$500] Chat - Email pattern is not recognized when sending a comment[/+]on Oct 30, 2023
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.92-4 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-11-06. 🎊
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:
[@burczu] The PR that introduced the bug has been identified. Link to the PR: Didn't find any.
[@burczu] 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
[@burczu] 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
[@burczu] Determine if we should create a regression test for this bug. I don't think we need regression tests here - the issue didn't break any crucial flows of the App.
[@burczu] 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.
[@Christinadobrzyn] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
Issue Reporter: $50 @tsa321 (paid through Upwork)
Contributor: $500 + $250 @burczu (no payment since they are a contractor)
Contributor+: $500 + $250 @eh2077 (paid through Upwork)
Activity
[-]Chat - Email pattern is not recognized when sending a comment[/-][+][$500] Chat - Email pattern is not recognized when sending a comment[/+]melvin-bot commentedon Oct 2, 2023
Job added to Upwork: https://www.upwork.com/jobs/~0181685d1a16ff4d31
melvin-bot commentedon Oct 2, 2023
Triggered auto assignment to @Christinadobrzyn (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Oct 2, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)melvin-bot commentedon Oct 2, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @jjcoffee (
External)Christinadobrzyn commentedon Oct 2, 2023
I can reproduce this. Keeping External label.
ZhenjaHorbach commentedon Oct 2, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue
Email pattern is not recognized and the email is not always displayed correctly after the tags (
<code>in this case)What is the root cause of that problem?
Imperfect regex for autoEmail which we use in common library
https://github.com/Expensify/expensify-common/blob/ab4895807dd9a26f64bfaee80db15ee2c48a5124/lib/ExpensiMark.js#L127-L135
What changes do you think we should make in order to solve the problem?
We can update regex for autoEmail
For example:
https://github.com/Expensify/expensify-common/blob/ab4895807dd9a26f64bfaee80db15ee2c48a5124/lib/ExpensiMark.js#L130-L133
(?![^<]>|[^<>]<\/(?!em)) ([^\w'#%+-`]|||
)${CONST.REG_EXP.MARKDOWN_EMAIL}(?!((?:(?!<a).)+)?<\/a>|[^<]*(<\/pre>|<\/code>))Screen.Recording.2023-10-02.at.19.23.32.mov
akamefi202 commentedon Oct 2, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Email pattern is not recognized when sending a comment with inline code & email.
What is the root cause of that problem?
If we send any comment,
ExpensiMarkclass ofexpensify-commonrepo translates the comment into html text.If the user sends above comment,
inlineCodeBlockregex processes the text first.Then the regex for
autoEmailblocks replacement if the comment contains any tag just before email, only except<em>tag.https://github.com/Expensify/expensify-common/blob/ab4895807dd9a26f64bfaee80db15ee2c48a5124/lib/ExpensiMark.js#L130-L134
What changes do you think we should make in order to solve the problem?
We need to update the regex for
autoEmailto allow</code>&</pre>tag just before email.I suggest to replace
<\\/(?!em)with<\\/(?!em|code|pre).In other words, replace
(?![^<]*>|[^<>]*<\\/(?!em))with(?![^<]*>|[^<>]*<\\/(?!em|code|pre)).Previous
autoEmailregex blocks replacement if the comment contains any closing tag just before email, except</em>tag.But the updated regex will allow replacement if the comment contains
</em>,</pre>,</code>tag just before email.Previous regex works like above so the email pattern is not recognized.
But updated regex will work like above so the email pattern will be recognized successfully.
I've confirmed that this fix is working well without any regression by jest testing.
What alternative solutions did you explore? (Optional)
N/A
52 remaining items
[-][$500] Chat - Email pattern is not recognized when sending a comment[/-][+][HOLD for payment 2023-11-06] [$500] Chat - Email pattern is not recognized when sending a comment[/+]melvin-bot commentedon Oct 30, 2023
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Oct 30, 2023
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.92-4 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-11-06. 🎊
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:
melvin-bot commentedon Oct 30, 2023
burczu commentedon Oct 31, 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:
Christinadobrzyn commentedon Nov 6, 2023
hey @burczu or @eh2077, do you have a regression test?
burczu commentedon Nov 7, 2023
@Christinadobrzyn As I wrote in my previous comment:
Christinadobrzyn commentedon Nov 7, 2023
Payouts due:
Issue Reporter: $50 @tsa321 (paid through Upwork)
Contributor: $500 + $250 @burczu (no payment since they are a contractor)
Contributor+: $500 + $250 @eh2077 (paid through Upwork)
Eligible for 50% #urgency bonus? Y - based on #28629 (comment)
Upwork job is here.
Christinadobrzyn commentedon Nov 7, 2023
Paid based on this payment structure. Closing this GH as complete