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

[Awaiting Checklist Completion] [$500] Compose-User suggestions displays all number contacts with suffix @ expensify.sms #31100

Closed
3 of 6 tasks
izarutskaya opened this issue Nov 9, 2023 · 38 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

Comments

@izarutskaya
Copy link

izarutskaya commented Nov 9, 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!


Version Number: 1.3.97-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:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause-Internal Team
Slack conversation: @

Action Performed:

Pre-condition: Have many phone number contacts

  1. Go to https://staging.new.expensify.com/

  2. Tap on a group chat

  3. Enter @

  4. Scroll user suggestions and search for numbers contacts

  5. Note the suffix part of number contacts

  6. Tap on any number contact

Expected Result:

The user suggestions must not display number contacts with suffix @ expensify.sms.

Actual Result:

The user suggestions displays all number contacts with suffix @ expensify.sms.

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

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

Add any screenshot/video evidence

Bug6269618_1699512480081.dms.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~011be12bd2a89d07fc
  • Upwork Job ID: 1722543126423429120
  • Last Price Increase: 2023-11-09
  • Automatic offers:
    • shubham1206agra | Reviewer | 27806332
    • dukenv0307 | Contributor | 27806334
@izarutskaya izarutskaya added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 9, 2023
@melvin-bot melvin-bot bot changed the title Compose-User suggestions displays all number contacts with suffix @ expensify.sms [$500] Compose-User suggestions displays all number contacts with suffix @ expensify.sms Nov 9, 2023
Copy link

melvin-bot bot commented Nov 9, 2023

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

Copy link

melvin-bot bot commented Nov 9, 2023

Job added to Upwork: https://www.upwork.com/jobs/~011be12bd2a89d07fc

Copy link

melvin-bot bot commented Nov 9, 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

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

melvin-bot bot commented Nov 9, 2023

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

@dukenv0307
Copy link
Contributor

dukenv0307 commented Nov 9, 2023

Proposal

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

The user suggestions displays all number contacts with suffix @ expensify.sms.

What is the root cause of that problem?

We're not calling Str.removeSMSDomain on the list of mentions.

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

Call Str.removeSMSDomain on the list of mentions. It can be added inside getMentionOptions

And we should add sms domain again when we insert a suggestion

OptionListUtils.addSMSDomainIfPhoneNumber(mentionObject.alternateText)

const mentionCode = mentionObject.text === CONST.AUTO_COMPLETE_SUGGESTER.HERE_TEXT ? CONST.AUTO_COMPLETE_SUGGESTER.HERE_TEXT : `@${mentionObject.alternateText}`;

OPTION: In MentionUserRender, we also can remove the sms domain to display the mention as well without domain.

What alternative solutions did you explore? (Optional)

We can add an extra field to suggestion to display the display name and consider using LocalePhoneNumber.formatPhoneNumber as well to format the phone number properly for display and we will use alternateText to insert the mention.

@5war00p
Copy link
Contributor

5war00p commented Nov 9, 2023

Proposal

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

The user mention suggestions are displaying suffix(@expensify.sms) for numbers

What is the root cause of that problem?

In SuggestionMention.js, inside getMentionOptions, If user doesn't set the displayname then we are fallbacking to details.login which can be email or phone.

const sortedPersonalDetails = _.sortBy(filteredPersonalDetails, (detail) => detail.displayName || detail.login);
_.each(_.first(sortedPersonalDetails, CONST.AUTO_COMPLETE_SUGGESTER.MAX_AMOUNT_OF_SUGGESTIONS - suggestions.length), (detail) => {
suggestions.push({
text: detail.displayName,
alternateText: detail.login,
icons: [
{
name: detail.login,
source: UserUtils.getAvatar(detail.avatar, detail.accountID),
type: 'avatar',
fallbackIcon: detail.fallbackIcon,
},
],
});
});

In here it's becoming an phone and adding the suffix without a check

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

We can have a check at the alternateText, if it is email then add suffix if not we not we can show the phone number which can be handled by getDisplayName function from PersonalDetails.js

alternateText: getDisplayName(detail.login, sortedPersonalDetails),

What alternative solutions did you explore? (Optional)

NA

@melvin-bot melvin-bot bot added the Overdue label Nov 13, 2023
@twisterdotcom
Copy link
Contributor

@shubham1206agra how are these proposals looking to you?

@melvin-bot melvin-bot bot removed the Overdue label Nov 13, 2023
@shubham1206agra
Copy link
Contributor

Give me some time. I will give my review tomorrow first thing.

@shubham1206agra
Copy link
Contributor

@dukenv0307's proposal seems good to me.

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Nov 14, 2023

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

@5war00p
Copy link
Contributor

5war00p commented Nov 14, 2023

@shubham1206agra Issue here is to show alternate text as same as text, why do we need to handle this logic instead we can call getDisplayName directly right by passing specific personal details?

@shubham1206agra
Copy link
Contributor

@shubham1206agra Issue here is to show alternate text as same as text, why do we need to handle this logic instead we can call getDisplayName directly right by passing specific personal details?

Why do we need to show the same text and alternative text? It doesn't make sense.

@iwiznia
Copy link
Contributor

iwiznia commented Nov 14, 2023

We can have a check at the alternateText, if it is email then add suffix if not we not we can show the phone number which can be handled by getDisplayName function from PersonalDetails.js

I am not sure I follow, login will ALWAYS be an email.
Also, what is the correct behavior for a user that only has set a phone number? Show the phone number twice?

@shubham1206agra
Copy link
Contributor

We can have a check at the alternateText, if it is email then add suffix if not we not we can show the phone number which can be handled by getDisplayName function from PersonalDetails.js

I am not sure I follow, login will ALWAYS be an email. Also, what is the correct behavior for a user that only has set a phone number? Show the phone number twice?

Show phone number once ig. There is a condition for that.

Screenshot 2023-11-15 at 3 15 50 PM

But looks like the text (display name) and alternative text are not exactly the same, so the condition is failing for now. This may require a fix from the backend.

@5war00p
Copy link
Contributor

5war00p commented Nov 15, 2023

Also, please do change the property name, it should be called as subtitle or subtext. The name alternate_text is misleading though.

@dukenv0307
Copy link
Contributor

dukenv0307 commented Nov 15, 2023

I don't think we need to display the same for the phone number case, one is the display name, and one is the login field. And I think it's expected that we format display name of phone number, we only need to remove the suffix when we display alternateText.

@iwiznia
Copy link
Contributor

iwiznia commented Nov 15, 2023

Show phone number once ig. There is a condition for that.

What does ig mean? Where's that condition?

@shubham1206agra
Copy link
Contributor

shubham1206agra commented Nov 16, 2023

Where's that condition?

In MentionSuggestions, this line is present

const styledHandle = item.text === item.alternateText ? '' : getStyledTextArray(item.alternateText, props.prefix);

@iwiznia
Copy link
Contributor

iwiznia commented Nov 16, 2023

Ah ok, so why are the texts not the same?

@shubham1206agra
Copy link
Contributor

shubham1206agra commented Nov 16, 2023

Ah ok, so why are the texts not the same?

I don't know. I think it comes from the backend itself.
@dukenv0307 If possible, can you investigate this?

@dukenv0307
Copy link
Contributor

I will update soon.

@dukenv0307
Copy link
Contributor

dukenv0307 commented Nov 23, 2023

@iwiznia

I want to know why. What exactly is the backend call that returns this data and what data it is returning in the text and alternateText and why are they different?

As you can see, the display name for the phone number account is formatted. In the suggestion list now, text is display name, and alternateText is the login field and this is different from the image here. So we should format the login in alternateText by using formatPhoneNumber to make both texts are the same.

Screenshot 2023-11-23 at 11 01 12

Copy link

melvin-bot bot commented Nov 23, 2023

@iwiznia @twisterdotcom @shubham1206agra 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!

@iwiznia
Copy link
Contributor

iwiznia commented Nov 23, 2023

Ah I see, thanks for explaining!

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 23, 2023
Copy link

melvin-bot bot commented Nov 23, 2023

📣 @shubham1206agra 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Nov 23, 2023

📣 @dukenv0307 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@dukenv0307
Copy link
Contributor

@shubham1206agra The PR is ready for review.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Nov 30, 2023
@melvin-bot melvin-bot bot changed the title [$500] Compose-User suggestions displays all number contacts with suffix @ expensify.sms [HOLD for payment 2023-12-07] [$500] Compose-User suggestions displays all number contacts with suffix @ expensify.sms Nov 30, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Nov 30, 2023
Copy link

melvin-bot bot commented Nov 30, 2023

Reviewing label has been removed, please complete the "BugZero Checklist".

Copy link

melvin-bot bot commented Nov 30, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.5-7 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 2023-12-07. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Nov 30, 2023

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:

  • [@shubham1206agra] The PR that introduced the bug has been identified. Link to the PR:
  • [@shubham1206agra] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@shubham1206agra] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@shubham1206agra] Determine if we should create a regression test for this bug.
  • [@shubham1206agra] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@twisterdotcom] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Dec 7, 2023
@twisterdotcom
Copy link
Contributor

Payment Summary:

@shubham1206agra paid $500 here (Reviewer)
@dukenv0307 paid $500 here (Contributor)

Awaiting Checklist Completion

@twisterdotcom twisterdotcom removed the Awaiting Payment Auto-added when associated PR is deployed to production label Dec 7, 2023
@twisterdotcom twisterdotcom changed the title [HOLD for payment 2023-12-07] [$500] Compose-User suggestions displays all number contacts with suffix @ expensify.sms [Awaiting Checklist Completion] [$500] Compose-User suggestions displays all number contacts with suffix @ expensify.sms Dec 7, 2023
@shubham1206agra
Copy link
Contributor

@twisterdotcom I think this is more of a UI improvement. If we agree on this, checklist is not required in that case.

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
Projects
None yet
Development

No branches or pull requests

6 participants