Skip to content

[HOLD for payment 2023-07-14] [$1000] Web - Phone number is shown twice in the preview tooltip. #21197

Closed

Description

@kbecciv

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. Opened the website.
  2. Hovered over the account without a name that contains a phone number.
  3. Observed that the tooltip displays the contact details twice.

Expected Result:

The phone number should not be shown twice in the tooltip.

Actual Result:

The phone number is shown twice in the preview tooltip.

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.27-6

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

Notes/Photos/Videos: Any additional supporting documentation

Screenshot 2023-06-21 at 3 46 04 AM

Recording.5064.mp4

Expensify/Expensify Issue URL:

Issue reported by: @Tushu17

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~011baa54223aee0feb
  • Upwork Job ID: 1671800200350584832
  • Last Price Increase: 2023-06-22

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jun 21, 2023
  2. melvin-bot commented on Jun 21, 2023

    @melvin-bot

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

  3. melvin-bot commented on Jun 21, 2023

    @melvin-bot

    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
  4. manjesh-yadav commented on Jun 21, 2023

    @manjesh-yadav
    Contributor

    Proposal

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

    Web - Phone number is shown twice in the preview tooltip

    What is the root cause of that problem?

    We display two texts in the tooltip displayName and login

    <Text style={[styles.mt2, styles.textMicroBold, styles.textReactionSenders, styles.textAlignCenter]}>
    {String(userDetails.displayName).trim() ? userDetails.displayName : ''}
    </Text>
    <Text style={[styles.textMicro, styles.fontColorReactionLabel]}>
    {String(userDetails.login || '').trim() && !_.isEqual(userDetails.login, userDetails.displayName) ? Str.removeSMSDomain(userDetails.login) : ''}
    </Text>

    if login and displayName is the same we do not display the second text

    we check this by this line of code

    {String(userDetails.login || '').trim() && !_.isEqual(userDetails.login, userDetails.displayName) ? Str.removeSMSDomain(userDetails.login) : ''}
    1. When user sign up with with there phone number we save the displayName same as the phone number and login id append with SMS domain "+phoneNumber@expensify.sms"
    2. For the phone number case our condition failed to check login and displayName is same and we display same number twice

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

    While signup time, we have a method formatPhoneNumber in 'src/libs/LocalePhoneNumber.js' which is used to convert phone number to displayName

    We can use the same method to check if login phone number is the same as the current displayName as (Why current? Because the user can update their displayName in the future)

    if this return true if do not show the second text otherwise show

    snippets:

    const formatLoginIdAsDisplayName =  (login) => {
            if(!login){
                return null;
            }
    
            // If login type is not phone number return same login
            if(!Str.isSMSLogin(login)){
                return login;
            }
            // Remove SMS domain and format phone number as DisplayName
            return LocalePhoneNumber.formatPhoneNumber(Str.removeSMSDomain(login))
        }
    
    //Now call this like
    
    {String(userDetails.login || '').trim() && !_.isEqual(formatLoginIdAsDisplayName(userDetails.login), userDetails.displayName)? Str.removeSMSDomain(userDetails.login) : ''}
    Result
    display-name.mp4

    What alternative solutions did you explore? (Optional)

    If we do not want to show phone number in tooltip

    from:

    {String(userDetails.login || '').trim() && !_.isEqual(userDetails.login, userDetails.displayName) ? Str.removeSMSDomain(userDetails.login) : ''}

    to like this:

    {String(userDetails.login || '').trim() && !_.isEqual(userDetails.login, userDetails.displayName) && !Str.isSMSLogin(userDetails.login) ? Str.removeSMSDomain(userDetails.login) : ''}
  5. Tushu17 commented on Jun 21, 2023

    @Tushu17
    Contributor

    Proposal

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

    Phone number is shown twice in tooltip on user with no name.

    What is the root cause of that problem?

    In the UserDetailsTooltip component, we are currently checking whether userDetails.login is equal to userDetails.displayName in order to determine if the user has a display name or not. This approach works correctly for accounts that use email as the login method. However, for phone number accounts, the userDetails.displayName string differs from the userDetails.login string.

    {String(userDetails.login || '').trim() && !_.isEqual(userDetails.login, userDetails.displayName) ? Str.removeSMSDomain(userDetails.login) : ''}

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

    We can check if user has a empty userDetails.firstName and userDetails.lastName instead of checking userDetails.displayName

    {String(userDetails.login).trim() && _.isEmpty(userDetails.firstName) && _.isEmpty(userDetails.lastName) ? '' : Str.removeSMSDomain(userDetails.login)}

    What alternative solutions did you explore? (Optional)

    Na

  6. conorpendergrast commented on Jun 22, 2023

    @conorpendergrast
    Contributor

    Reproduced on OSX desktop app too. Thanks!

  7. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jun 22, 2023
  8. changed the title [-]Web - Phone number is shown twice in the preview tooltip.[/-] [+][$1000] Web - Phone number is shown twice in the preview tooltip.[/+] on Jun 22, 2023
  9. melvin-bot commented on Jun 22, 2023

    @melvin-bot
  10. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jun 22, 2023
  11. melvin-bot commented on Jun 22, 2023

    @melvin-bot

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

  12. melvin-bot commented on Jun 22, 2023

    @melvin-bot

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

  13. 40 remaining items

  14. Santhosh-Sellavel commented on Jul 14, 2023

    @Santhosh-Sellavel
    Collaborator

    Requested payment on ND

  15. conorpendergrast commented on Jul 17, 2023

    @conorpendergrast
    Contributor

    Contract sent to @manjesh-yadav, waiting for @Tushu17 to apply to the job.

  16. conorpendergrast commented on Jul 17, 2023

    @conorpendergrast
    Contributor
  17. conorpendergrast commented on Jul 17, 2023

    @conorpendergrast
    Contributor
  18. Tushu17 commented on Jul 17, 2023

    @Tushu17
    Contributor

    Contract sent to @manjesh-yadav, waiting for @Tushu17 to apply to the job.

    @conorpendergrast I'm not able to access the job posting, Ig you haven't shared the correct link. Can you just send me an invitation to my Upwork ID? https://www.upwork.com/freelancers/~01d43dd6772957dbb0

  19. Santhosh-Sellavel commented on Jul 17, 2023

    @Santhosh-Sellavel
    Collaborator

    @Tushu17 here is the link provided earlier it works for me

    https://www.upwork.com/jobs/~011baa54223aee0feb

  20. Tushu17 commented on Jul 17, 2023

    @Tushu17
    Contributor

    Thank you, @Santhosh-Sellavel. @conorpendergrast I've applied for the job.

  21. conorpendergrast commented on Jul 17, 2023

    @conorpendergrast
    Contributor

    Sorry, there are so many "fun" URLs in Upwork. I've sent the offer now! Once that's accepted, I'll pay that, then will leave this open to make sure that Santhosh gets paid via New Dot

  22. Tushu17 commented on Jul 17, 2023

    @Tushu17
    Contributor

    @conorpendergrast I've accepted the offer. Thank you.

  23. conorpendergrast commented on Jul 18, 2023

    @conorpendergrast
    Contributor

    Paid! Keeping this open until Santhosh gets paid via New Dot

  24. anmurali commented on Jul 18, 2023

    @anmurali

    Approved $1500 (with bonus) for Santhosh on ND

  25. conorpendergrast commented on Jul 18, 2023

    @conorpendergrast
    Contributor

    Nice, thanks. All done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions