Open m-natarajan opened 1 week ago
Triggered auto assignment to @mallenexpensify (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.
Job added to Upwork: https://www.upwork.com/jobs/~021845828693936391795
Triggered auto assignment to Contributor-plus team member for initial proposal review - @shubham1206agra (External
)
Edited by proposal-police: This proposal was edited at 2024-10-14 14:27:47 UTC.
Mention doesn't work when the mention has '
.
Looks like this only happens on short mentions. When we do a complete mention, for example, @bernhard.josephus@gmail.com's
, only @bernhard.josephus@gmail.com
is matched as the mention, and 's
is treated as a normal text.
But when we do short mentions, for example, @bernhard.josephus's
, all text is matched as a mention. That's because the regex accepts '
.
https://github.com/Expensify/App/blob/0bb5806d60a69303b6d37ebde4d23450714c2ce2/src/CONST.ts#L2754
Based on this SO, '
is a valid character for an email before the @
character.
And because there is no contact with an email that contains '
, the full mention can't be built.
https://github.com/Expensify/App/blob/0bb5806d60a69303b6d37ebde4d23450714c2ce2/src/libs/ReportUtils.ts#L4176-L4178
If we don't want to accept '
as part of the short mention, then we can remove it from the regex.
https://github.com/Expensify/App/blob/0bb5806d60a69303b6d37ebde4d23450714c2ce2/src/CONST.ts#L2754
What if the short mention has an '
in it?
Was able to reproduce, i wonder if this is a bug or new feature. Meaning... was this ever discussed before, where we decide NOT to tag a user with 's
at the end of their handle. (guessing not, just seems like it's worked this way from the start)
@flodnv if the email has '
in it, then it won't be converted to a mention. The user needs to type the full mention. But I just tested that our full user mention regex can't match either if there is '
in it.
Mention is not working with possessive forms like 's
Regex is not handling Possessive forms
Updating Regex to handle Apostrophes, Email Mentions, and Possessives.
SHORT_MENTION: new RegExp(`@[\\w\\-\\+#']+(?:\\.[\\w\\-\\+#']+)*(?:@[\\w\\-]+\\.[a-z]{2,})?(?![^\`]*\`)(?=\\b|'s)`, 'gim'),
Details on updating regex :
@bernha'ard.josephus@gmail.com
.@mallenexpensify, @shubham1206agra Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
@mallenexpensify I don't think we can omit '
from the short mention check. We must find another solution to this problem since slack has no problem handling it.
Does Slack have a short mention?
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
I'm uncertain of the Slack's logic or exactly how they handle it, check the vid below
https://github.com/user-attachments/assets/7f911179-ff79-4bd3-bcca-f3835fe8443a
@mallenexpensify, @shubham1206agra Whoops! This issue is 2 days overdue. Let's get this updated quick!
@mallenexpensify, @shubham1206agra Eep! 4 days overdue now. Issues have feelings too...
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.0.48-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 Expensify/Expensify Issue URL: Issue reported by: @flodnv Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1728591305161159
Action Performed:
something @user
in a room (the mention must be the short version without the email part)something @user
with a trailing space's
Expected Result:
The @mentioned user is highlighted in the sent message as
something @user's
Actual Result:
The
@user
part is not marked as a mention and message is sent as plain textWorkaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
https://github.com/user-attachments/assets/a76f0845-7388-4e7b-8ffe-0318f6d85ebc
Add any screenshot/video evidence
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @shubham1206agra