Skip to content
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

[$1000] Chat - SMS domain shown in mentions #20866

Closed
2 of 6 tasks
kbecciv opened this issue Jun 15, 2023 · 15 comments
Closed
2 of 6 tasks

[$1000] Chat - SMS domain shown in mentions #20866

kbecciv opened this issue Jun 15, 2023 · 15 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@kbecciv
Copy link

kbecciv commented Jun 15, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Have some previous chats with phone number
  2. Go to any chat
  3. Start mentioning phone number

Expected Result:

Phone number alone should be shown

Actual Result:

Phone number is shown with expensify sms domain

Workaround:

Unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.28.3

Reproducible in staging?: yes

Reproducible in production?: yes

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

Notes/Photos/Videos: Any additional supporting documentation

image (64)
Screenshot 2023-06-08 at 9 23 57 PM

Expensify/Expensify Issue URL:

Issue reported by: @abdulrahuman5196

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1686239745633599

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01180378586a3144b1
  • Upwork Job ID: 1669613431669092352
  • Last Price Increase: 2023-06-16
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 15, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 15, 2023

Triggered auto assignment to @bfitzexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Jun 15, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@Pujan92

This comment was marked as outdated.

@bfitzexpensify bfitzexpensify added the External Added to denote the issue can be worked on by a contributor label Jun 16, 2023
@melvin-bot melvin-bot bot changed the title Chat - SMS domain shown in mentions [$1000] Chat - SMS domain shown in mentions Jun 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 16, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01180378586a3144b1

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 16, 2023

Current assignee @bfitzexpensify is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented Jun 16, 2023

Triggered auto assignment to Contributor-plus team member for initial proposal review - @Santhosh-Sellavel (External)

@dhairyasenjaliya
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue.

  • Chat - SMS domain shown in mentions

What is the root cause of that problem?

  • The root cause is we are not adding any filter to remove domain extensions from the number

What changes do you think we should make in order to solve the problem?

  • We need 2 changes in order to remove the SMS domain as well as filter data as that we omit by removing the sms domain

Change - 1

  • 1st change is to remove the SMS domain from the alternateText which can be found here and apply Str.removeSMSDomain

alternateText: detail.login,

Change - 2

  • Another change is to filter data as per the Ommited SMS domain which will be found here and apply same Str.removeSMSDomain

  • If we don't add filter change and then type @exp then also it will render a number that has an extension of @expensify on it, so it does not make any sense to show that since we already removed the domain from displayed mention.

if (searchValue && !`${detail.displayName} ${detail.login}`.toLowerCase().includes(searchValue.toLowerCase())) {

Result if we don't add changes - 2

Screenshot 2023-06-16 at 1 44 41 PM

Final result

Screenshot 2023-06-16 at 1 43 58 PM

Note : At time of adding this proposal non other proposal suggest to remove domain from search as well

@tienifr
Copy link
Contributor

tienifr commented Jun 16, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.

SMS domain shown in mentions.

What is the root cause of that problem?

Currently we do not allow phone number mentions without SMS domain. We do not remove the SMS domain when displaying it in both the mention suggestions and the message.

What changes do you think we should make in order to solve the problem?

  1. Remove SMS domain in mention suggestions in alternateText:

alternateText: detail.login,

  1. Update regex in expensify-common to allow mentions with phone number only. Otherwise, the phone number will not be parsed with <mention-user> tag and thus not displayed as mention. (I think this is the trickiest part but we'll handle that in the PR if assigned)

  2. To allow user to navigate to mentioned account, we need to add the SMS domain back into the phone number in MentionUserRenderer using OptionsListUtils.addSMSDomainIfPhoneNumber. Since this format is recognized as the primary login:

const loginWithoutLeadingAt = props.tnode.data.slice(1);

  1. (Optional) In case we want to completely eliminate the SMS domain while searching for mentions as in the above proposal, we need to remove SMS domain from detail.login here too:

if (searchValue && !`${detail.displayName} ${detail.login}`.toLowerCase().includes(searchValue.toLowerCase())) {

What alternative solutions did you explore? (Optional)

NA

Results

image

image

FIY, without the second step in my solution, the mention will be displayed as plain text in the message:

image

@bfitzexpensify
Copy link
Contributor

Couple of proposals ready for review @Santhosh-Sellavel

@Santhosh-Sellavel
Copy link
Collaborator

@bfitzexpensify I'll post my review comments tomorrow. Need to check this further.

@melvin-bot melvin-bot bot added the Overdue label Jun 22, 2023
@Santhosh-Sellavel
Copy link
Collaborator

@tienifr's Proposal here look good to me. Both proposals are mostly similar, but @tienifr's proposal mentioned the highlighting of the phone number which will be missing, so we should go with them.

(Optional) In case we want to completely eliminate the SMS domain while searching for mentions as in the above proposal, we need to remove SMS domain from detail.login here too:

I think we need to exclude the results while searching with SMS domain

C+ Reviewed
🎀 👀 🎀

@melvin-bot melvin-bot bot removed the Overdue label Jun 22, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 22, 2023

Triggered auto assignment to @flodnv, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@flodnv
Copy link
Contributor

flodnv commented Jun 23, 2023

@puneetlath can you check this please? It has to do with mentions (and some of it came from #19221)

@flodnv flodnv assigned puneetlath and unassigned flodnv Jun 23, 2023
@melvin-bot melvin-bot bot added the Overdue label Jun 26, 2023
@puneetlath
Copy link
Contributor

This isn't really a bug. This is how it will have to be until we implement handles.

@melvin-bot melvin-bot bot removed the Overdue label Jun 26, 2023
@puneetlath
Copy link
Contributor

I'm going to close, but feel free to reopen if you disagree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
None yet
Development

No branches or pull requests

8 participants