-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
App considers number emojis as part of link #26632
Comments
Triggered auto assignment to @zanyrenney ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalPlease re-state the problem that we are trying to solve in this issue.App considers number emojis as part of link What is the root cause of that problem?Our issue here lies in ExpensiMark, in specific it lies in URL_PATH_REGEX which is a regex used to decide the returned link of MARKDOWN_URL_REGEX. The issue with the regex that is URL_PATH_REGEX is \w which is is matching any word character (a-z, A-Z, 0-9, and underscore) and that's causing the issue here because number emojis are structured as follows:
In combination, javascript for example will understand the 1 emojis as "\u0031\uFE0F\u20E3" with u0031 being the number 1 and as far as javascript is concerned these are 3 seperate items so it will take the first one and use it as it's an actual number which will be considered a match for \w. What changes do you think we should make in order to solve the problem?What we should do here is use Negative Lookahead (?!...) and include the unicode that is used in number emojis which will be something like this (?!\ufe0f\u20e3]) which is telling javascript that if it sees a digit followed by these specific unicode characters that are used in emojis then it should not match \w const URL_PATH_REGEX = `(?:${addEscapedChar('[.,=(+$!*]')}?\\/${addEscapedChar('[-\\w$@.+!*:(),=%~](?![\\ufe0f\\u20e3])')}*${addEscapedChar('[-\\w~@:%](?![\\ufe0f\\u20e3])')}|\\/)*`; ResultScreen.Recording.2023-09-04.at.1.07.34.PM.mov |
have asked a question in the channel |
As this is a super niche edge case, and not a user-reported error. I am going to close this bug report. There is no real workflow where a user would make take this action of deleting part of a link and replacing the link with an emoji of the letter in the link unless it was in searching for breaking the App as opposed to a natural/user error workflow. |
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:
App should not consider any emoji as part of link
Actual Result:
App considers number emojis as part of link
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.62-1
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
emojis.as.part.of.link.mp4
emoji.mp4
Expensify/Expensify Issue URL:
Issue reported by: @dhanashree-sawant
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1692637594208169
View all open jobs on GitHub
The text was updated successfully, but these errors were encountered: