-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[HOLD for payment 2024-02-07] MEDIUM: [$500] Drop domain name in mentions if chat members are on the same domain #32534
Comments
Triggered auto assignment to @stephanieelliott ( |
Bug0 Triage Checklist (Main S/O)
|
A few things to add here:
For email-based mentions:
For accountID-based mentions:
Does that sound good? |
Job added to Upwork: https://www.upwork.com/jobs/~0173ab1d6ef6e3a31a |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Drop domain name in mentions if chat members are on the same domain What is the root cause of that problem?This is new feature What changes do you think we should make in order to solve the problem?We need to modify the
More details on implementation, there could be minor variations/fixes required but the below should be the main changes:
The If the emails are not in the same private domain, we also return the Otherwise, the emails must be of the same private domain, so we should remove the domain part and return the user "handle".
And here for the case of email-based mention
We need to use Then here, change What alternative solutions did you explore? (Optional)The above is in the mention renderer, if we want it to display the same way in LHN as well, we need to make additional changes and potentially some back-end changes as well. |
ProposalPlease re-state the problem that we are trying to solve in this issue.MEDIUM: Drop domain name in mentions if chat members are on the same domain What is the root cause of that problem?NA - Feature Request What changes do you think we should make in order to solve the problem?We just need to render through the rules of things first flow.
// Checking if the rendering mention is login i.e email
const isDisplyingLogin = displayNameOrLogin === lodashGet(user, 'login', '');
// Check if the email is valid, if so extract the email
const mentionUserEmailDomain = isDisplyingLogin && Str.isValidEmail(displayNameOrLogin) && Str.extractEmailDomain(displayNameOrLogin);
const currentUserEmailDomian = Str.extractEmailDomain(props.currentUserPersonalDetails.login);
const isPublicDomain = StrConst.PUBLIC_DOMAINS.includes(mentionUserEmailDomain.toLowerCase());
const isSameOriginEmail = mentionUserEmailDomain === currentUserEmailDomian;
if (isSameOriginEmail && isDisplyingLogin && !isOurMention && !isPublicDomain) {
displayNameOrLogin = Str.replaceAll(`@${currentUserEmailDomian}`, '');
} This fills all the conditions.
What alternative solutions did you explore? (Optional)NA |
ProposalPlease re-state the problem that we are trying to solve in this issue.Drop domain name in mentions if chat members are on the same domain What is the root cause of that problem?Feature request What changes do you think we should make in order to solve the problem?In
We already have built-in functions for above tasks. let displayMention = displayNameOrLogin;
if (displayNameOrLogin && Str.isValidEmail(displayNameOrLogin) && !LoginUtils.isEmailPublicDomain(props.currentUserPersonalDetails.login)) {
currentUserDomain = Str.extractEmailDomain(props.currentUserPersonalDetails.login);
if (currentUserDomain === Str.extractEmailDomain(displayNameOrLogin)) {
displayMention = Str.extractEmail(displayNameOrLogin);
}
} And use it to render mention. What alternative solutions did you explore? (Optional)NA |
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! |
@quinthar design doc is protected, can you please share the link with read permission? thanks |
Ah, what's your email address so I can share it with you? |
@quinthar Can you share gijoe0295@gmail.com? Thanks! |
@quinthar it's |
Also I have requested the read or (maybe edit) from docs itself. |
Shared! |
Got it, thanks :) |
Hm, reading the design doc, and I'm not actually sure it ever finished the design for "simplified handles". @NikkiWines are you sure this is ready for a contributor to pick up? I think we should first finish the design doc for this to make sure we all agree on how it's going to work, before taking it out for proposals. |
I am reviewing the PR now. |
C+ review has been completed, PR is now just waiting on a few minor change requests to be addressed by @tienifr before merge. |
PR is updated, just awaiting a final review |
PR is merged and undergoing QA |
This PR is on staging 👏 |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.33-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2024-02-07. 🎊 For reference, here are some details about the assignees on this issue:
|
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
Hey @sobitneupane can you complete the BZ checklist when you get a chance? |
Payment Summary
BugZero Checklist (@stephanieelliott)
|
Bump @sobitneupane, can you complete the BZ checklist? |
It's a feature request not a bug. So, I don't think the checklist applies here. |
Regression test proposal
Do we agree 👍 or 👎 |
Testrail issue created: https://github.com/Expensify/Expensify/issues/368461 @tienifr offer extended in Upwork, please accept when you get a chance! |
All paid, thanks! |
$500 approved for @sobitneupane based on this summary. |
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:
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 domainE.g. viewing as
nikki@notification.com
, no common domainActual 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 domainE.g. viewing as
nikki@notification.com
, no common domainWorkaround:
N/A
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
N/A
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: