App: [HOLD for payment 2024-02-07] MEDIUM: [$500] Drop domain name in mentions if chat members are on the same domain

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: v1.4.8-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: N/A Email or phone of affected tester (no customers): all customers on private domains Logs: N/A Expensify/Expensify Issue URL: N/A Issue reported by: N/A Slack conversation: https://expensify.slack.com/archives/C066HJM2CAZ/p1701743829149999

Action Performed:

  1. Create a room with 4 members: 2 on the same private domain, 1 on another private domain, and 1 on a public domain
  2. As each member, send a message mentioning each other member

Expected Result:

If the user looking at the chat is on the same domain as the person being mentioned, they should not see the domain (e.g. @user@expensify.com) in the mention. They should see a shortened mention containing only the email prefix (e.g. @user)

If the user looking at the chat is not on the same domain as the person being mentioned, or if the user being mentioned is on a public domain, then they should see the full mention (e.g. @user@gmail.com)

E.g. viewing as nikki@meep.com, which has a common domain image

E.g. viewing as nikki@notification.com, no common domain image

Actual Result:

Regardless of whether or not users share a domain, the mention is always the full mention (e.g. @user@expensify.com)

E.g. viewing as nikki@meep.com, which has a common domain image

E.g. viewing as nikki@notification.com, no common domain image

Workaround:

N/A

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

N/A

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0173ab1d6ef6e3a31a
  • Upwork Job ID: 1732819861042143232
  • Last Price Increase: 2023-12-29

About this issue

  • Original URL
  • State: closed
  • Created 7 months ago
  • Comments: 74 (48 by maintainers)

Most upvoted comments

A few things to add here:

  • This should only be the case for private domains (e.g. expensify.com). For public domains (e.g. gmail.com) should always use the full email. We have a list of public domains in expensify-common here. So if my email address is puneet@gmail.com and I’m viewing a mention of nikki@gmail.com it should show as @nikki@gmail.com not @nikki
  • The app supports both email based mentions - <mention-user>@person@gmail.com</mention-user> - and accountID-based mentions - <mention-user accountID=1234></mention-here>. We should make sure that the solution works for both of them. So I would think that maybe it’s as follows.

For email-based mentions:

  1. Look at the email address in the mention
  2. If it’s on the same private domain as mine, render as @person. Otherwise render as @person@domain.com

For accountID-based mentions:

  1. Look at the personalDetails object for the accountID
  2. If we don’t have a personalDetail for that accountID, render as @Hidden
  3. If we have a personalDetail, but we don’t have a display name or login in there, render as @Hidden
  4. If we have a personalDetail with display name, but no login, render as @Display Name
  5. if we have a personalDetail with login, render the same way as email-based mentions

Does that sound good?

Regression test proposal

  1. Create a room with 4 members: 2 on the same private domain, 1 on another private domain, and 1 on a public domain
  2. As each member, send a message mentioning each other member
  3. If the user looking at the chat is on the same domain as the person being mentioned, they should not see the domain (e.g. @user@expensify.com) in the mention. They should see a shortened mention containing only the email prefix (e.g. @user)
  4. If the user looking at the chat is not on the same domain as the person being mentioned, or if the user being mentioned is on a public domain, then they should see the full mention (e.g. @user@gmail.com)

Do we agree 👍 or 👎

Thanks for the update @tienifr

Proposal from @tienifr looks good to me.

🎀 👀 🎀 C+ reviewed

I think we should treat your own domain same as any other (so don’t cut it down if it’s public domain).

@sobitneupane the changes are done in MentionUser.js which is the custom Component we use to render the mention tag.

The solution I explained is straight solution, first we solve the rendering value (based on email or accountID the existing value never changes), once we have the current rendering value then we do the new changes i.e checking for email.

Hey all, now that I’ve caught up with the doc and this discussion… it feels like you all know what’s going on way better than me! I’m taking this off hold.

@sobitneupane what are the next steps – do you evaluate and select the proposals? Let’s get this party started!

Dropping this down to weekly while it’s on hold

FYI, before doing anything on this, please read this entire @mentions design doc to make sure you understand the full context. Also, be sure to call out anything inaccurate. If we’re going to do something different than the doc says, or do it in a different order, let’s update the doc FIRST to reflect the real plan – and THEN do the coding. Thanks!