-
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
[HOLD for payment 2023-03-22] [$1000] Emails inside link and normal text behave differently for specific characters #15621
Comments
Triggered auto assignment to @garrettmknight ( |
Bug0 Triage Checklist (Main S/O)
|
Job added to Upwork: https://www.upwork.com/jobs/~01b3b7bbe257a58a4e |
Current assignee @garrettmknight is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Santhosh-Sellavel ( |
Triggered auto assignment to @cristipaval ( |
@abdulrahuman5196 Looks like you had a proposal in thread, want to put that here? |
@garrettmknight Thank you tagging ProposalI was the reporter of this bug and proposed a solution as part of the bug report here - https://expensify.slack.com/archives/C049HHMV9SM/p1677859222866439?thread_ts=1677706040.537379&cid=C049HHMV9SM Please re-state the problem that we are trying to solve in this issue.Emails inside link and normal text are not behaving same way on click/tooltip/email address link formation when emails have specific character. What is the root cause of that problem?We are using different regex to validate email in 'email' and 'autoEmail' rule in ExpensiMark.js AutoEmail rule has the latest regex change made sometime back but the email rule has outdated regex. What changes do you think we should make in order to solve the problem?This is a straight-forward fix. We should make the email and autoEmail rule consistent. As autoEmail has the latest regex we should propagate it to email rule as well. We should create a common place for email regex and use it for email and autoEmail so that this issue doesn't occur in future. We should form the new 'email' rule regex by just having to append the existing part of regex to find '[text]' link to exiting autoEmail rule regex link(which we can move to common place), so that autoEmail and email rules behaves consistently. Optional: We can also update '[text]' regex to ignore specific characters but it might be out of scope of this issue. What alternative solutions did you explore? (Optional)None |
I don't think it's overdue for now. @Santhosh-Sellavel are we still waiting for other proposals? |
Missed this one, reviewing soon! |
Thanks for the proposal @abdulrahuman5196 what will the new behavior can you list some examples |
The expected behaviour is text and 'emailAddress' should recognise valid emailIds in the same way. But it doesn't do the same way now. For example Eg 1: textMessage =
Here in the link email segment ~ is considered as valid email and in the second plain email section ~ is not considered valid email character
Here in the link email segment * is considered as valid email and in the second plain email section * is not considered valid email character This was due to recently changes for valid email regex was done only at https://github.com/Expensify/expensify-common/blob/main/lib/ExpensiMark.js#L100 but the same was not propogated to link email https://github.com/Expensify/expensify-common/blob/main/lib/ExpensiMark.js#L60 After our change in the above example *,~ won't be recognised as valid email character. In both the example only 'test@gmail.com' will be recognised as valid email Id. @Santhosh-Sellavel Let me know if I was clear or more information is required. |
@abdulrahuman5196 Screenshot or recording of input & result would be clear! |
Before change: Untitled.6.mp4After change: Untitled.7.mp4 |
@Santhosh-Sellavel Kindly take a look into the above videos and let me know if we need more information |
@abdulrahuman5196 proposal LGTM! C+ Reviewed |
Thanks @Santhosh-Sellavel ! |
@cristipaval or @garrettmknight assign @abdulrahuman5196 this one, thanks! |
Thank you for assigning the issue. @Santhosh-Sellavel @cristipaval I have created a PR for the fix |
@cristipaval Thank you merging the expensify-common PR. @Santhosh-Sellavel I have created a related ExpensifyApp PR as well - #15821 |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.2.84-1 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-03-22. 🎊 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.
As a reminder, here are the bonuses/penalties that should be applied for any External 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:
|
Looks like something related to As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our Feel free to drop a note in #expensify-open-source with any questions. |
I'm not sure if this was introduced in a PR or whether it's always been this way inline with the note above.
This seems like a pretty niche edge case since the unexpected behavior only happens with special characters at the beginning of the email address so I don't think an RT is necessary. @Santhosh-Sellavel @cristipaval thoughts? |
|
You're right @abdulrahuman5196. After looking at git history, it seems like there have always been 2 markdowns for emails which didn't reuse the same regex. |
I agree RT is unnecessary! @garrettmknight |
@cristipaval We can check off the checklist as we don't need a discussion here! |
@garrettmknight I believe only payment is due here and the PR qualifies for a speed bonus also, thanks! |
Everyone's paid! Closing |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Expected Result:
Both should behave similar way and ignore *~ characters.
Actual Result:
The specific characters not considered in normal text while inside link its considered as email.
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.2.78-0
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:
Screen.Recording.2023-03-02.at.2.56.14.AM.mov
Recording.1615.mp4
Expensify/Expensify Issue URL:
Issue reported by: @abdulrahuman5196
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1677706040537379
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: