[$250] Chat - Edit comment of mentions with username is not highlighted
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: V9.2.32-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://test-management.browserstack.com/projects/2219752/folder/13176723/test-cases/41237044 Email or phone of affected tester (no customers): Slottwo1 [email protected] Issue reported by: Applause Internal Team Device used: Redminote 10s android 13 phone App Component: Chat Report View
Action Performed:
- Launch app
- Open 1:1 DM
- Send 2 mentions seperately as 2 messages:
- A. Email without name @[email protected]
- B. Email with username - @[email protected]
- Open edit comment
Expected Result:
Edit comment of mentions with username must be highlighted.
Actual Result:
Edit comment of mentions with username is not highlighted but username as email id highlighted.
Workaround:
Unknown
Platforms:
- [x] Android: App
- [x] Android: mWeb Chrome
- [ ] iOS: App
- [ ] iOS: mWeb Safari
- [ ] iOS: mWeb Chrome
- [x] Windows: Chrome
- [ ] MacOS: Chrome / Safari
- [ ] MacOS: Desktop
Screenshots/Videos
https://github.com/user-attachments/assets/ac672227-fc9a-4049-b082-8ec28ee920c7
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~021981438143279259297
- Upwork Job ID: 1981438143279259297
- Last Price Increase: 2025-12-25
Issue Owner
Current Issue Owner: @parasharrajat
Triggered auto assignment to @stephanieelliott (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.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Edit comment of mentions with username is not highlighted but username as email id highlighted.
What is the root cause of that problem?
-
When mentioning by name, it uses the
mention-shortformat, and if the name isn’t included inavailableMentions, it won’t be highlighted.
https://github.com/Expensify/App/blob/e4aabe2748871ac61eadfc2f5f423494e47080a2/src/libs/ParsingUtils.ts#L19-L39 Mentions using email are of typemention-user, so they are always highlighted. -
availableMentionsis derived from theavailableLoginsListinuseShortMentionsList. Currently,useShortMentionsListalways disallows highlighting for public domains.
https://github.com/Expensify/App/blob/e4aabe2748871ac61eadfc2f5f423494e47080a2/src/libs/LoginUtils.ts#L106-L109 Also,availableLoginsListonly pulls frompersonalDetail.login, which may differ from thedisplayName, somention-shortwon’t be highlighted. https://github.com/Expensify/App/blob/e4aabe2748871ac61eadfc2f5f423494e47080a2/src/hooks/useShortMentionsList.ts#L32-L33
What changes do you think we should make in order to solve the problem?
- We should allow highlighting for public domains. This condition can be discussed and aligned with the design team. https://github.com/Expensify/App/blob/e4aabe2748871ac61eadfc2f5f423494e47080a2/src/hooks/useShortMentionsList.ts#L28
const isEmailPublicDomainPersonalDetail = isEmailPublicDomain(personalDetail.login);
const isEmailPublicDomainCurrentUser = isEmailPublicDomain(currentUserPersonalDetails.login ?? '');
// If the emails are not in the same private domain, we don't want to highlight them
if (
isEmailPublicDomainCurrentUser !== isEmailPublicDomainPersonalDetail ||
(!isEmailPublicDomainCurrentUser && !areEmailsFromSamePrivateDomain(personalDetail.login, currentUserPersonalDetails.login ?? ''))
) {
Note: Alternatively, we could add a shouldAllowPublicDomain parameter to areEmailsFromSamePrivateDomain to achieve a similar result.
- In addition to retrieving the email, we should also include the
displayName. https://github.com/Expensify/App/blob/e4aabe2748871ac61eadfc2f5f423494e47080a2/src/hooks/useShortMentionsList.ts#L32-L35
const [username] = personalDetail.login.split('@');
const result = [username];
if (personalDetail.displayName && personalDetail.displayName !== personalDetail.login) {
const [displayName] = personalDetail.displayName.split('@');
result.push(displayName);
}
return result;
})
.flat()
.filter((login): login is string => !!login);
https://github.com/user-attachments/assets/a3fab41a-12de-4b79-8d90-52422c60818c
Job added to Upwork: https://www.upwork.com/jobs/~021981438143279259297
Triggered auto assignment to Contributor-plus team member for initial proposal review - @parasharrajat (External)
Proposal looks good, but we need to check why we restricted shortnames highlight for public domains earlier.
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@parasharrajat @stephanieelliott this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
I have next update tomorrow morning.
@parasharrajat Huh... This is 4 days overdue. Who can take care of this?
Hey @parasharrajat what's the latest on this one?
@stephanieelliott I checked the code and we were intentionally not highlighting emails from public domain. Can you confirm whether we want to change it or not?
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@parasharrajat just want to make sure I'm understanding - is the lack of highlight on public domain emails intentional only after editing? The gmail address was highlighted before the edit, but lost the highlight after editing.
So I’m trying to figure out:
- is it a bug that they lose the highlight after editing?
- or is it a bug that they were ever highlighted in the first place?
Triggered auto assignment to @RachCHopkins (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.
Adding the Bug label to reassign this as I am going on leave til Dec 1.
Status: There seems to be a bug here, unclear if it's that public domain mentions are being highlighted OR that mentions lose their highlight after editing. See https://github.com/Expensify/App/issues/72755#issuecomment-3498017313 and https://github.com/Expensify/App/issues/72755#issuecomment-3500400128
Good point let me check that.
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@parasharrajat @stephanieelliott @RachCHopkins this issue is now 4 weeks old, please consider:
- Finding a contributor to fix the bug
- Closing the issue if BZ has been unable to add the issue to a VIP or Wave project
- If you have any questions, don't hesitate to start a discussion in #expensify-open-source
Thanks!
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
This issue has not been updated in over 14 days. @parasharrajat, @stephanieelliott, @RachCHopkins eroding to Weekly issue.
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@parasharrajat how did you get on with this?
Sorry for the delay on this.
I just checked that issue on staging. Whenever I try to tag a user with a username, I always get their email. @RachCHopkins can you try this?
https://github.com/user-attachments/assets/a71e75b5-ac7c-4771-ba0c-0b4db5c59c64
@dmkt9 Any hints on how to tag a user with username?
@dmkt9 Any hints on how to tag a user with username?
I don’t remember any special step. At the moment I’ve tried tagging a user, but I can’t make it display as the username.
@jponikarchuk Can you confirm whether it is still possible to tag usernames or has that been changed?
@parasharrajat The use without username is shown as Hidden now. When editing the comment, mentions (both with and without a username) are not highlighted now.
https://github.com/user-attachments/assets/d9e92b43-355d-4c13-b817-20aaac05f04c
@jponikarchuk Do you have updated steps to reproduce this issue?
@parasharrajat We have no way to check this issue now