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
[$175] Chat - short mention with a single character followed by dot isn't recognized #104159
Version Number: 9.5.10-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:https://github.com/Expensify/Expensify/issues/557782 Issue reported by: Applause Internal Team Bug source: Regression TC Execution Device used: Windows Windows 11 - Chrome
Action Performed:
Open the WS chat
Send a short mention with a single character followed by dot (for example, @j.doe)
⚠️Preliminary analysis (low confidence): treat this as a starting point, not a conclusion.
I don't think this is a code bug in the current build. The same bug was already fixed in expensify-common, and version 9.5.10 ships with that fix. More likely, the test accounts don't meet the conditions for short mentions.
changed the title [-]Chat - short mention with a single character followed by dot isn't recognized[/-][+][$175] Chat - short mention with a single character followed by dot isn't recognized[/+]on Oct 15, 2026
Please re-state the problem that we are trying to solve in this issue.
In chat, typing a short mention that starts with a single character followed by a dot (e.g. @j.doe) does not highlight or convert into a recognized mention badge when sent.
In accordance with Expensify's architecture guidelines:
"Short mention - a special type of mention that contains only the login part of a user email AND the email domain has to be the same as our email domain. Any other @mention will not get highlighted if domains don't match."
In the attached video, the workspace is Applause's Workspace 16!.
The only member invited in the chat history is zc (fdbvdbxzn@gmail.com).
There is no member j.doe or j.doe@applause.expensifail.com in personal details or workspace members.
Because j.doe is not an existing user on the sender's private domain, the app intentionally does not format @j.doe into a mention badge (preventing arbitrary @strings from becoming broken mention links).
This is the exact identical situation seen in Issue #96348 (which had the identical regression test case ID https://github.com/Expensify/Expensify/issues/557782), where the issue was confirmed not reproducible / invalid test prerequisites and closed.
What changes do you think we should make in order to solve the problem?
Primary Recommendation (QA / Test Verification):
Verify with proper test prerequisites:
Ensure the logged-in user is on a private domain (e.g. user1@testdomain.com).
Invite a member whose login has a single character followed by a dot on the same private domain (e.g. j.doe@testdomain.com).
Type @j.doe in the workspace chat.
Result: The mention @j.doe is highlighted in the composer via decorateRangesWithShortMentions and sends as <mention-user>@j.doe@testdomain.com</mention-user> as expected.
Alternative (If Product Team wants short mentions to resolve across all workspace members regardless of domain matching):
If product design decides that short mentions within workspace chats should resolve for any workspace member even across different or public domains, we should update useShortMentionsList.ts and ReportUtils.ts to look up member logins from report.participants or policy.employeeList instead of strictly enforcing currentUserDomain === memberDomain:
In src/hooks/useShortMentionsList.ts:
--- a/src/hooks/useShortMentionsList.ts+++ b/src/hooks/useShortMentionsList.ts@@ -28,9 +28,6 @@ const buildAvailableLoginsList = memoize(
if (!personalDetails) {
return emptyLoginsList;
}
const currentUserDomain = getEmailDomain(currentUserLogin);
- if (isDomainPublic(currentUserDomain)) {- return emptyLoginsList;- }
const availableLogins: string[] = [];
for (const personalDetail of Object.values(personalDetails)) {
- if (!personalDetail?.login || getEmailDomain(personalDetail.login) !== currentUserDomain) {+ if (!personalDetail?.login) {
continue;
}
const [username] = personalDetail.login.split('@');
if (username) {
availableLogins.push(username);
}
}
return availableLogins;
What alternative solutions did you explore? (Optional)
Investigated whether autocomplete suggestion handling in SuggestionMention.tsx had an issue with dotted handles; confirmed that PR #81262 already added normalizedPrefix handling for trailing dots, so typing @j. or @j.doe matches any existing member whose handle starts with j. without issues.
after sending, the message shows a proper mention for @r.bhati@stacklance.in
So a short mention with a single character followed by a dot works when both users share a private domain. My guess is the tester used accounts on a public domain (like gmail.com) or on different domains, where short mentions are not supported by design (useShortMentionsList returns an empty list for public domains). That matches what MelvinBot suggested above.
It may be worth asking the tester which two logins they used before going further.
Please re-state the problem that we are trying to solve in this issue.
In chat, short user mentions where the username starts with a single character followed by a dot (e.g. @j.doe) are not recognized as valid mentions.
What is the root cause of that problem?
In src/libs/MentionUtils.ts (and CONST.REGEX.MENTION / CONST.REGEX.USER_MENTION), the regex pattern governing user mentions requires at least two alphanumeric characters before a dot separator or boundary (e.g. [a-zA-Z0-9_-]{2,}). When a handle uses a standard initials-based format like j.doe, the single-character prefix fails the length quantifier and is treated as plain text rather than a mention token.
What changes do you think we should make in order to solve the problem?
In src/CONST.ts and src/libs/MentionUtils.ts, update CONST.REGEX.MENTION to permit single-character prefixes preceding a period (e.g., (?<=^|\s)@([a-zA-Z0-9_-]+(?:\.[a-zA-Z0-9_-]+)*)).
Ensure unit tests in tests/unit/MentionUtilsTest.ts cover single-character dotted usernames like @j.doe and @a.b.
What alternative solutions did you explore? (Optional)
Restricting mentions to full email addresses, which degrades UX for short usernames and workspace handles.
Tests
Open any chat room in New Expensify.
In the compose box, type @j.doe and press send.
Verify the mention is recognized, styled as a mention pill/link, and autocompletes correctly.
Verify mentions like @john.doe and @user continue to work properly.
Please re-state the problem that we are trying to solve in this issue.
In a workspace chat, sending a short mention starting with a single character followed by a dot (e.g. @j.doe) does not convert into an active mention badge or trigger mention styling.
What is the root cause of that problem?
1. Analysis of the Tokenizer / Parser:
The mention regex for short mentions in ExpensiMark.ts / expensify-common@2.0.211 already supports single-character prefixes followed by a dot (following PRs expensify-common#881 and expensify-common#891).
Running the parser on @j.doe:
<mention-short>@j.doe</mention-short>
The tokenization itself works properly and is covered by upstream unit tests (ExpensiMark-HTML-test.js:1791-1799).
2. Root Cause in Resolution Layer (useShortMentionsList.ts & ParsingUtils.ts):
"Short mention - a special type of mention that contains only the login part of a user email AND the email domain has to be the same as our email domain. Any other @mention will not get highlighted if domains don't match."
In src/hooks/useShortMentionsList.ts (lines 28–43):
And in src/libs/ParsingUtils.ts (decorateRangesWithShortMentions & addDomainToShortMention), a <mention-short> token only resolves and converts to <mention-user> if username exists in availableLogins.
Why it did not highlight in the reporter's video:
In the attached video, the workspace is Applause's Workspace 16!.
The sender is an external tester account (@applause.expensifail.com).
There is no member named j.doe or j.doe@applause.expensifail.com in the workspace members or personal details list.
Because j.doe is not an existing user sharing the sender's private domain, the app intentionally leaves @j.doe as plain text to prevent arbitrary strings prefixed with @ from turning into broken mention links.
This is identical to Issue #96348 (which tested the exact same test case ID https://github.com/Expensify/Expensify/issues/557782), where the issue was investigated and closed as invalid test prerequisites / not a bug.
What changes do you think we should make in order to solve the problem?
Option A: Close as Expected Behavior & Update Testrail Prerequisites (Recommended)
Verify with proper test prerequisites:
Ensure the sender is logged into an account on a private domain (e.g. admin@mycompany.com).
Add a member whose handle begins with a single char followed by a dot on the same private domain (e.g. j.doe@mycompany.com).
Type @j.doe in the workspace chat.
The mention highlights in the composer and sends as <mention-user>@j.doe@mycompany.com</mention-user> as expected.
Update the regression test steps to specify that the target member must exist on the same private domain.
Option B: Allow Short Mentions to Resolve for Any Workspace Member (If Product Change is Desired)
If product desires short mentions to resolve across any workspace member regardless of whether their email domain matches the sender's domain:
In src/hooks/useShortMentionsList.ts:
--- a/src/hooks/useShortMentionsList.ts+++ b/src/hooks/useShortMentionsList.ts@@ -28,9 +28,6 @@ const buildAvailableLoginsList = memoize(
if (!personalDetails) {
return emptyLoginsList;
}
const currentUserDomain = getEmailDomain(currentUserLogin);
- if (isDomainPublic(currentUserDomain)) {- return emptyLoginsList;- }
const availableLogins: string[] = [];
for (const personalDetail of Object.values(personalDetails)) {
- if (!personalDetail?.login || getEmailDomain(personalDetail.login) !== currentUserDomain) {+ if (!personalDetail?.login) {
continue;
}
const [username] = personalDetail.login.split('@');
if (username) {
availableLogins.push(username);
}
}
return availableLogins;
What alternative solutions did you explore? (Optional)
Checked autocomplete suggestion filtering in SuggestionMention.tsx: Confirmed that PR #81262 already normalizes trailing dots, so typing @j. or @j.doe suggests matching users properly when they exist in member lists.
I Agree with Melvin #104159 (comment), this is not an issue, you must have j.doe in your personal detials to be able to mention him. e.g. invite them to a workspace first
What a short mention needs to resolve
The sender's login is on a private domain.
The mentioned user's login is on the same domain as the sender's.
The mentioned user is in the sender's personal details.
Activity
MelvinBot commentedon Oct 15, 2026
I don't think this is a code bug in the current build. The same bug was already fixed in
expensify-common, and version 9.5.10 ships with that fix. More likely, the test accounts don't meet the conditions for short mentions.Why the parser isn't the likely cause
expensify-commonat2.0.211. That version'sshortMentionsregex has both fixes.@j.doe→<mention-short>@j.doe</mention-short>(__tests__/ExpensiMark-HTML-test.js:1791-1799).What a short mention needs to resolve
A short mention only resolves if all of these are true (
src/hooks/useShortMentionsList.ts:27-43):If the check passes, the composer keeps the highlight (
src/libs/ParsingUtils.ts:23-43). Sending then expands it to a full mention (src/libs/ParsingUtils.ts:72-127). I found no rule in this path that limits length or dot placement.What I couldn't verify
To confirm, please share:
@john.doe, works with the same two accounts.If a same-domain pair still fails, that points to a new cause, and this needs a deeper look.
Next Steps: Reply with
@MelvinBot <your feedback>to refine this analysis.view run
melvin-bot commentedon Oct 15, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ahmedGaber93 (
External)[-]Chat - short mention with a single character followed by dot isn't recognized[/-][+][$175] Chat - short mention with a single character followed by dot isn't recognized[/+]melvin-bot commentedon Oct 15, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022110828231641473065
janiya2 commentedon Oct 15, 2026
Contributor details
Your Expensify account email: janithad2@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/janithad
Proposal
Please re-state the problem that we are trying to solve in this issue.
In chat, typing a short mention that starts with a single character followed by a dot (e.g.
@j.doe) does not highlight or convert into a recognized mention badge when sent.What is the root cause of that problem?
There are two layers involved in short mention handling in Expensify (as documented in
contributingGuides/MENTIONS_HIGHLIGHTING_IN_CHAT.md):Tokenization Layer (
ExpensiMark/expensify-common&@expensify/react-native-live-markdown):shortMentionsinExpensiMark.ts:expensify-common@2.0.211on@j.doeproduces:@j.doewithout issues.Resolution & Styling Layer (
useShortMentionsList.ts&ParsingUtils.ts):useShortMentionsList.ts:ParsingUtils.ts(decorateRangesWithShortMentions&addDomainToShortMention):Why it failed in the reporter's video:
Applause's Workspace 16!.zc(fdbvdbxzn@gmail.com).j.doeorj.doe@applause.expensifail.comin personal details or workspace members.j.doeis not an existing user on the sender's private domain, the app intentionally does not format@j.doeinto a mention badge (preventing arbitrary@stringsfrom becoming broken mention links).https://github.com/Expensify/Expensify/issues/557782), where the issue was confirmed not reproducible / invalid test prerequisites and closed.What changes do you think we should make in order to solve the problem?
Primary Recommendation (QA / Test Verification):
Verify with proper test prerequisites:
user1@testdomain.com).j.doe@testdomain.com).@j.doein the workspace chat.@j.doeis highlighted in the composer viadecorateRangesWithShortMentionsand sends as<mention-user>@j.doe@testdomain.com</mention-user>as expected.Alternative (If Product Team wants short mentions to resolve across all workspace members regardless of domain matching):
If product design decides that short mentions within workspace chats should resolve for any workspace member even across different or public domains, we should update
useShortMentionsList.tsandReportUtils.tsto look up member logins fromreport.participantsorpolicy.employeeListinstead of strictly enforcingcurrentUserDomain === memberDomain:In
src/hooks/useShortMentionsList.ts:What alternative solutions did you explore? (Optional)
Investigated whether autocomplete suggestion handling in
SuggestionMention.tsxhad an issue with dotted handles; confirmed that PR #81262 already addednormalizedPrefixhandling for trailing dots, so typing@j.or@j.doematches any existing member whose handle starts withj.without issues.melvin-bot commentedon Oct 15, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
stacklancer commentedon Oct 18, 2026
@ahmedGaber93 I tested this with two accounts on the same private domain (r.bhati@stacklance.in and rahul@stacklance.in) on web, on latest main.
From rahul@ I typed
@r.bhati testin the DM:@r.bhatias a mention@r.bhati@stacklance.inSo a short mention with a single character followed by a dot works when both users share a private domain. My guess is the tester used accounts on a public domain (like gmail.com) or on different domains, where short mentions are not supported by design (
useShortMentionsListreturns an empty list for public domains). That matches what MelvinBot suggested above.It may be worth asking the tester which two logins they used before going further.
jloa-dev commentedon Oct 19, 2026
Contributor details
Your Expensify account email: jloa.dev@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~01584ea0bc208b0a94
Proposal
Please re-state the problem that we are trying to solve in this issue.
In chat, short user mentions where the username starts with a single character followed by a dot (e.g.
@j.doe) are not recognized as valid mentions.What is the root cause of that problem?
In
src/libs/MentionUtils.ts(andCONST.REGEX.MENTION/CONST.REGEX.USER_MENTION), the regex pattern governing user mentions requires at least two alphanumeric characters before a dot separator or boundary (e.g.[a-zA-Z0-9_-]{2,}). When a handle uses a standard initials-based format likej.doe, the single-character prefix fails the length quantifier and is treated as plain text rather than a mention token.What changes do you think we should make in order to solve the problem?
src/CONST.tsandsrc/libs/MentionUtils.ts, updateCONST.REGEX.MENTIONto permit single-character prefixes preceding a period (e.g.,(?<=^|\s)@([a-zA-Z0-9_-]+(?:\.[a-zA-Z0-9_-]+)*)).tests/unit/MentionUtilsTest.tscover single-character dotted usernames like@j.doeand@a.b.What alternative solutions did you explore? (Optional)
Restricting mentions to full email addresses, which degrades UX for short usernames and workspace handles.
Tests
@j.doeand press send.@john.doeand@usercontinue to work properly.melvin-bot commentedon Oct 19, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
bonnhatnguyen commentedon Oct 19, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
In a workspace chat, sending a short mention starting with a single character followed by a dot (e.g.
@j.doe) does not convert into an active mention badge or trigger mention styling.What is the root cause of that problem?
1. Analysis of the Tokenizer / Parser:
The mention regex for short mentions in
ExpensiMark.ts/expensify-common@2.0.211already supports single-character prefixes followed by a dot (following PRs expensify-common#881 and expensify-common#891).Running the parser on
@j.doe:The tokenization itself works properly and is covered by upstream unit tests (
ExpensiMark-HTML-test.js:1791-1799).2. Root Cause in Resolution Layer (
useShortMentionsList.ts&ParsingUtils.ts):As documented in
contributingGuides/MENTIONS_HIGHLIGHTING_IN_CHAT.md:In
src/hooks/useShortMentionsList.ts(lines 28–43):And in
src/libs/ParsingUtils.ts(decorateRangesWithShortMentions&addDomainToShortMention), a<mention-short>token only resolves and converts to<mention-user>ifusernameexists inavailableLogins.Why it did not highlight in the reporter's video:
Applause's Workspace 16!.@applause.expensifail.com).j.doeorj.doe@applause.expensifail.comin the workspace members or personal details list.j.doeis not an existing user sharing the sender's private domain, the app intentionally leaves@j.doeas plain text to prevent arbitrary strings prefixed with@from turning into broken mention links.https://github.com/Expensify/Expensify/issues/557782), where the issue was investigated and closed as invalid test prerequisites / not a bug.What changes do you think we should make in order to solve the problem?
Option A: Close as Expected Behavior & Update Testrail Prerequisites (Recommended)
Verify with proper test prerequisites:
admin@mycompany.com).j.doe@mycompany.com).@j.doein the workspace chat.<mention-user>@j.doe@mycompany.com</mention-user>as expected.Update the regression test steps to specify that the target member must exist on the same private domain.
Option B: Allow Short Mentions to Resolve for Any Workspace Member (If Product Change is Desired)
If product desires short mentions to resolve across any workspace member regardless of whether their email domain matches the sender's domain:
In
src/hooks/useShortMentionsList.ts:What alternative solutions did you explore? (Optional)
SuggestionMention.tsx: Confirmed that PR #81262 already normalizes trailing dots, so typing@j.or@j.doesuggests matching users properly when they exist in member lists.Contributor details
Your Expensify account email: bonnhatnguyen0@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~0139ed4098bdc50182
melvin-bot commentedon Oct 19, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
melvin-bot commentedon Oct 20, 2026
@ahmedGaber93 Huh... This is 4 days overdue. Who can take care of this?
melvin-bot commentedon Oct 22, 2026
@ahmedGaber93 6 days overdue. This is scarier than being forced to listen to Vogon poetry!
melvin-bot commentedon Oct 26, 2026
@ahmedGaber93 10 days overdue. I'm getting more depressed than Marvin.
ahmedGaber93 commentedon Oct 27, 2026
I Agree with Melvin #104159 (comment), this is not an issue, you must have
j.doein your personal detials to be able to mention him. e.g. invite them to a workspace firstScreen.Recording.2026-10-27.at.9.45.51.AM.mov
ahmedGaber93 commentedon Oct 27, 2026
Closed, this is not an issue #104159 (comment).