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

[HOLD for payment 2023-09-27] [$1000] After deleting a mobile contact from a WorkSpace, it starts showing up in contacts as @expensify.sms #26121

Closed
2 of 6 tasks
izarutskaya opened this issue Aug 28, 2023 · 62 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@izarutskaya
Copy link

izarutskaya commented Aug 28, 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. Open https://staging.new.expensify.com/
  2. Log in with any of your logins
  3. Create a new workspace or open an existing one
  4. Open the workspace & click on "Members"
  5. Click on 'Invite' button
  6. Search for an invalid phone number (+2523234211)
  7. Select the user > click on "Next" > click on "Invite"
  8. Select the user & click on the "Remove" button
  9. Click on 'Invite' button

Expected Result:

The previously added contact should appear as a phone number, without the @expensify.sms termination

Actual Result:

A previously added contact is displayed as a phone number with @expensify.sms at the end

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: v1.3.58-0

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

Bug6180252_Recording__119.1.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal Team

Slack conversation:

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~014b0b1a782b2526c6
  • Upwork Job ID: 1696345977519468544
  • Last Price Increase: 2023-08-29
  • Automatic offers:
    • mollfpr | Reviewer | 26454047
    • pradeepmdk | Contributor | 26454050
@izarutskaya izarutskaya added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 28, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 28, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 28, 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

@c3024
Copy link
Contributor

c3024 commented Aug 28, 2023

Proposal

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

After deleting a phone contact from WS, it starts showing up in contacts as @expensify.sms in the invite page.

What is the root cause of that problem?

We are not formatting the @expensify.sms text anywhere for invite page.

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

We can remove the sms domain in CheckboxListItem with formatPhoneNumber of LocalePhoneNumber by importing like this

import * as LocalePhoneNumber from '../../libs/LocalePhoneNumber';

and update this

{LocalePhoneNumber.formatPhoneNumber(item.text)}

at

We can wrap the alternate text as well with this similar to the getParticipantsOptions of the OptionLisUtils
if we want to avoid it in cases for alternate text as well just to be safe but presently alternateText has no @expensify.sms portion to be removed.

{LocalePhoneNumber.formatPhoneNumber(item.alternateText)}

What alternative solutions did you explore? (Optional)

Solution 1
We can instead format the text directly in the OptionListUtils function formatMemberForList here

text: lodashGet(member, 'text', '') || lodashGet(member, 'displayName', ''),

with LocalePhoneNumber.formatPhoneNumber
and do it similarly for alternateText, name in Avatar if necessary.
This formatMemberForList function is used only for invite page and presently we are not showing any tooltip for CheckboxItem so this solution and the primary solution has no difference. But if we like to show tooltip later, then we need to remove .sms from the name of the tooltip as well. If and when tooltip is implemented, the text there need to be formatted again if we implement the first solution.
This solution is also preferable because the function is meant to format and the phone number formatting logic also is better to be implemented in this.

Solution 2 (too big a refactor for this bug)
Use the getParticipantOptions (because this function has already proper phone number formatting logic) of OptionListUtils to get participant details in workspace members and invite pages instead of individually formatting in the page itself (as done in members page) or each with formatMemberForList (in contacts page) and use the regular logic of using icons object with MultipleAvatars component to show Avatar and tooltips as earlier in CheckboxListItem.

@jliexpensify jliexpensify changed the title All - WS - After deleting a contact from WS, it starts showing up in contacts as @expensify.sms After deleting a contact from a WorkSpace, it starts showing up in contacts as @expensify.sms Aug 29, 2023
@jliexpensify
Copy link
Contributor

@jliexpensify jliexpensify added the External Added to denote the issue can be worked on by a contributor label Aug 29, 2023
@melvin-bot melvin-bot bot changed the title After deleting a contact from a WorkSpace, it starts showing up in contacts as @expensify.sms [$1000] After deleting a contact from a WorkSpace, it starts showing up in contacts as @expensify.sms Aug 29, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 29, 2023

Job added to Upwork: https://www.upwork.com/jobs/~014b0b1a782b2526c6

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

melvin-bot bot commented Aug 29, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 29, 2023

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

@jliexpensify jliexpensify changed the title [$1000] After deleting a contact from a WorkSpace, it starts showing up in contacts as @expensify.sms [$1000] After deleting a mobile contact from a WorkSpace, it starts showing up in contacts as @expensify.sms Aug 29, 2023
@pradeepmdk
Copy link
Contributor

pradeepmdk commented Aug 29, 2023

Proposal

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

After deleting a mobile contact from a WorkSpace, it starts showing up in contacts as @expensify.sms

What is the root cause of that problem?

Root cause is when we invite displayName stored in with domainName@expensify.sms in optimisticData
when we invite

const logins = _.map(_.keys(invitedEmailsToAccountIDs), (memberLogin) => OptionsListUtils.addSMSDomainIfPhoneNumber(memberLogin));

we are creating OptionsListUtils.addSMSDomainIfPhoneNumber for storing the optimisticData

displayName: login,

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

const logins = _.map(_.keys(invitedEmailsToAccountIDs), (memberLogin) => OptionsListUtils.addSMSDomainIfPhoneNumber(memberLogin));

we need remove OptionsListUtils.addSMSDomainIfPhoneNumber here and add it into

and

employees: JSON.stringify(_.map(logins, (login) => ({email: login}))),

so only we have this addSMSDomainIfPhoneNumber for login not for the displayName

or just formatting the
displayName: LocalePhoneNumber.formatPhoneNumber(login),

displayName: login,

Addional fix Needed same issue for other places

we need fix some other place too

  1. RequestMoney api optimisticData data
    displayName: participant.displayName || payerEmail,

    here participant.login is without domain so we need switch payerEmail to login
  2. split api above solution needed here
    displayName: participant.displayName || email,

@mollfpr
Copy link
Contributor

mollfpr commented Aug 29, 2023

Thanks for the proposals!

@c3024 @pradeepmdk Why does it only happen on the failing phone number deleted? The other phone number that is valid also has the domain in their displayName and login, but it displays just fine.

Screenshot 2023-08-29 at 22 05 18

@pradeepmdk
Copy link
Contributor

@mollfpr because when api falling onyxData empty but we stored in the optimisticData with OptionsListUtils.addSMSDomainIfPhoneNumber so that its happening. so that in my proposal remove the addSMSDomainIfPhoneNumber on display name

...newPersonalDetailsOnyxData.optimisticData,

Screenshot 2023-08-29 at 8 39 42 PM

@c3024
Copy link
Contributor

c3024 commented Aug 29, 2023

@mollfpr Is there a duplicate for the number 0878-... in the personal details or in the invite options in your screen?

@mollfpr
Copy link
Contributor

mollfpr commented Aug 29, 2023

Screenshot 2023-08-29 at 22 05 18

@pradeepmdk Sorry, I don't understand your point. In the above image, the valid phone number also has the domain, but it displays fine; why is that?

@c3024 Nope, it just added.

@c3024
Copy link
Contributor

c3024 commented Aug 29, 2023

Screenshot 2023-08-29 at 9 02 19 PM

If display name has expensify.sms then I think it should show expensify.sms because we are not stripping it anywhere. Just for clarification, there are no two options or personal details one with +62878732837@expensify.sms and another with 0 878-732-837 on your screen, right? @mollfpr

@mollfpr
Copy link
Contributor

mollfpr commented Aug 29, 2023

@c3024 Thanks, I understand now the issue is. Your alternative solution 1, looks good. We format the text and alternate text on the WorkspaceMembersPage, so I think we need to do the same for the invite page.

I think we don't have anything wrong with the API action and the optimistic data, so I prefer to keep it that way.

Let's go with @c3024 alternative solution 1 in their proposal. For note, I think we just need to format the text and alternateText, no need for the avatar.

🎀 👀 🎀 C+ reviewed!

@melvin-bot
Copy link

melvin-bot bot commented Aug 29, 2023

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

@pradeepmdk
Copy link
Contributor

pradeepmdk commented Aug 29, 2023

@mollfpr This issue was when we storing optimisticData in Onyx whenever API falling.

const logins = _.map(_.keys(invitedEmailsToAccountIDs), (memberLogin) => OptionsListUtils.addSMSDomainIfPhoneNumber(memberLogin));

...newPersonalDetailsOnyxData.optimisticData,

we need to fix the root case for avoiding the displayName store as @expensify.sms

OptionsListUtils.js
this will not solve all the places it will work only this place.

If you want check this exactly when api failed case phone number when we go to create task assignee means same like this format only it will displayed, same for moneyrequest, split bill as well
Screenshot 2023-08-29 at 9 36 21 PM
Screenshot 2023-08-29 at 9 37 01 PM

@pradeepmdk
Copy link
Contributor

pradeepmdk commented Aug 29, 2023

@mollfpr @Li357

I think we don't have anything wrong with the API action and the optimistic data, so I prefer to keep it that way.

this is wrong right? the display name with @expensify.sms.This happened only from optimisticData but API give correct response without @expensify.sms
Screenshot 2023-08-29 at 10 17 57 PM
If the AddMembersToWorkspace api is sucess means personalDetailsList displayname come with without @expensify.sms:
Screenshot 2023-08-30 at 5 35 26 AM

if we fix the displayname. all the place working correctly.

@Li357
Copy link
Contributor

Li357 commented Aug 30, 2023

@pradeepmdk Seems like you're right. I would prefer to fix the optimistic data generated, can you demonstrate this fix working everywhere we currently show @expensify.sms?

@mollfpr
Copy link
Contributor

mollfpr commented Aug 30, 2023

@pradeepmdk You have a good point on the optimistic data, but fixing the optimistic data is not enough. We also need to format the option list too. Otherwise, the issue still persists for the wrong existing data.

I also suspect that this issue is a regression from #22904.

@c3024
Copy link
Contributor

c3024 commented Aug 30, 2023

How about not showing the personal details with errors at all in the invite page?

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Sep 13, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 13, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 13, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.68-17 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-09-20. 🎊

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:

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Sep 13, 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:

  • [@mollfpr] The PR that introduced the bug has been identified. Link to the PR:
  • [@mollfpr] 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:
  • [@mollfpr] 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:
  • [@mollfpr] Determine if we should create a regression test for this bug.
  • [@mollfpr] 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.
  • [@jliexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Weekly KSv2 labels Sep 14, 2023
@pradeepmdk
Copy link
Contributor

@mollfpr Pr is ready

@melvin-bot
Copy link

melvin-bot bot commented Sep 14, 2023

Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:

  • when @pradeepmdk got assigned: 2023-09-01 15:49:35 Z
  • when the PR got merged: 2023-09-14 16:55:48 UTC
  • days elapsed: 9

On to the next one 🚀

@jliexpensify
Copy link
Contributor

Bump @mollfpr to complete the checklist!

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Sep 19, 2023
@mollfpr
Copy link
Contributor

mollfpr commented Sep 19, 2023

@jliexpensify The second PR is still on QA, so the payment date will be change.

@jliexpensify
Copy link
Contributor

@mollfpr is this the other PR? #26638

@mollfpr
Copy link
Contributor

mollfpr commented Sep 20, 2023

@jliexpensify It's #27408

@jliexpensify jliexpensify changed the title [HOLD for payment 2023-09-20] [$1000] After deleting a mobile contact from a WorkSpace, it starts showing up in contacts as @expensify.sms [HOLD for payment 2023-09-25] [$1000] After deleting a mobile contact from a WorkSpace, it starts showing up in contacts as @expensify.sms Sep 20, 2023
@jliexpensify
Copy link
Contributor

Cool, just changed the payment date and will check back next week to see how things are going - thanks!

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Sep 20, 2023
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2023-09-25] [$1000] After deleting a mobile contact from a WorkSpace, it starts showing up in contacts as @expensify.sms [HOLD for payment 2023-09-27] [HOLD for payment 2023-09-25] [$1000] After deleting a mobile contact from a WorkSpace, it starts showing up in contacts as @expensify.sms Sep 20, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Sep 20, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 20, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 20, 2023

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

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:

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Sep 20, 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:

  • [@mollfpr] The PR that introduced the bug has been identified. Link to the PR:
  • [@mollfpr] 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:
  • [@mollfpr] 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:
  • [@mollfpr] Determine if we should create a regression test for this bug.
  • [@mollfpr] 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.
  • [@jliexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@jliexpensify jliexpensify changed the title [HOLD for payment 2023-09-27] [HOLD for payment 2023-09-25] [$1000] After deleting a mobile contact from a WorkSpace, it starts showing up in contacts as @expensify.sms [HOLD for payment 2023-09-27] [$1000] After deleting a mobile contact from a WorkSpace, it starts showing up in contacts as @expensify.sms Sep 25, 2023
@jliexpensify
Copy link
Contributor

Payment Summary:

Upworks Job

@mollfpr bump to complete the checklist, thanks!

@mollfpr
Copy link
Contributor

mollfpr commented Sep 27, 2023

[@mollfpr] The PR that introduced the bug has been identified. Link to the PR:
[@mollfpr] 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:

I couldn't find the offending PR.

[@mollfpr] 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:

The regression step should be enough.

[@mollfpr] Determine if we should create a regression test for this bug.
[@mollfpr] 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.

For WorkSpace

  1. Open https://staging.new.expensify.com/
  2. Open the workspace or create one & click on "Members"
  3. Click on the 'Invite' button
  4. Search for an invalid phone number (+2523234211)
  5. Select the user > click on "Next" > click on "Invite"
  6. Select the user & click on the "Remove" button
  7. Click on the 'Invite' button
  8. Verify the display name on the newly added user without the domain name

For Request Money

  1. Open the Request money from the fab menu
  2. go to offline
  3. Create a Request money with an invalid phone number (either manual or distance)
  4. Verify the display name on the chat page without the domain name

For Split bill

  1. Open the Split bill from the fab menu
  2. go to offline
  3. Create split money with an invalid phone number
  4. Verify the display name on the chat page without the domain name

@jliexpensify
Copy link
Contributor

Paid and job closed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
None yet
Development

No branches or pull requests

6 participants