App icon indicating copy to clipboard operation
App copied to clipboard

[HOLD for payment 2024-12-17] [$250] iOS/Android - Contact method - Contact method not displayed until re-login or cleaning cache

Open IuliiaHerets opened this issue 1 year ago β€’ 29 comments

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.71.3 Reproducible in staging?: Y Reproducible in production?: N If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/5291147 Issue reported by: Applause Internal Team

Action Performed:

  1. Open the app and log in
  2. Navigate to Account settings > Profile > Contact methods
  3. Select New contact method
  4. Enter an email of a new contact method
  5. Enter the magic code and tap the Verify button

Expected Result:

New unverified contact method with GBR is displayed in the table

Actual Result:

New unverified contact method is not displayed in the table until user re-logs in or clears cache and restarts

Workaround:

Unknown

Platforms:

  • [x] Android: Standalone
  • [x] Android: HybridApp
  • [ ] Android: mWeb Chrome
  • [x] iOS: Standalone
  • [x] iOS: HybridApp
  • [ ] iOS: mWeb Safari
  • [ ] MacOS: Chrome / Safari
  • [ ] MacOS: Desktop

Screenshots/Videos

https://github.com/user-attachments/assets/73b8c741-cc11-44c5-958a-dec26c02c2a5

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021864287613376718300
  • Upwork Job ID: 1864287613376718300
  • Last Price Increase: 2024-12-04
  • Automatic offers:
    • brunovjk | Reviewer | 105248372
    • mkzie2 | Contributor | 105248373
Issue OwnerCurrent Issue Owner: @muttmuure

IuliiaHerets avatar Dec 03 '24 18:12 IuliiaHerets

Triggered auto assignment to @AndrewGable (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

melvin-bot[bot] avatar Dec 03 '24 18:12 melvin-bot[bot]

Triggered auto assignment to @muttmuure (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

melvin-bot[bot] avatar Dec 03 '24 18:12 melvin-bot[bot]

πŸ’¬ A slack conversation has been started in #expensify-open-source

melvin-bot[bot] avatar Dec 03 '24 18:12 melvin-bot[bot]

:wave: Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

github-actions[bot] avatar Dec 03 '24 18:12 github-actions[bot]

Production

https://github.com/user-attachments/assets/39455658-ab12-4012-afea-10fbcce538ee

IuliiaHerets avatar Dec 03 '24 18:12 IuliiaHerets

I'm curious if our site stability issues are causing this, but I will look at recent PRs since I'm not 100% sure this should be broken on staging and not prod.

AndrewGable avatar Dec 03 '24 19:12 AndrewGable

:wave: Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

github-actions[bot] avatar Dec 03 '24 21:12 github-actions[bot]

Triggered auto assignment to @yuwenmemon (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

melvin-bot[bot] avatar Dec 03 '24 21:12 melvin-bot[bot]

πŸ’¬ A slack conversation has been started in #expensify-open-source

melvin-bot[bot] avatar Dec 03 '24 21:12 melvin-bot[bot]

:wave: Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

github-actions[bot] avatar Dec 03 '24 21:12 github-actions[bot]

I can reproduce on staging, checking production now.

AndrewGable avatar Dec 03 '24 21:12 AndrewGable

Confirmed cannot reproduce on production

AndrewGable avatar Dec 03 '24 21:12 AndrewGable

Ok I confirmed I cannot reproduce on the version 9.0.66 of production, however, I think this actually occurs on 9.0.69 which is production according to the branches. I believe this was introduced because of https://github.com/Expensify/App/pull/49937

I see a diff for the ContactsMethodPage on this PR (and none recently before that), which makes me think this is related. @mountiny and @kirillzyusko @hannojg @chrispader do you mind confirming?

Removing deploy blocker because it's on production.

AndrewGable avatar Dec 03 '24 22:12 AndrewGable

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

melvin-bot[bot] avatar Dec 04 '24 12:12 melvin-bot[bot]

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

melvin-bot[bot] avatar Dec 04 '24 12:12 melvin-bot[bot]

I can reproduce:

v9.0.71-0 Develop

https://github.com/user-attachments/assets/f84987ce-f6cf-41f6-b0c6-83aff73634f8

Looking for proposals.

brunovjk avatar Dec 04 '24 13:12 brunovjk

Seems like this must be either issue with the optimistic data management or issue from the backend returning wrong options

mountiny avatar Dec 04 '24 15:12 mountiny

Edited by proposal-police: This proposal was edited at 2024-12-05 09:01:29 UTC.

Proposal

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

New unverified contact method is not displayed in the table until user re-logs in or clears cache and restarts

What is the root cause of that problem?

When the validate code modal is closed, we check if loginData?.errorFields and pendingContactAction?.contactMethod exist we will clear the contact method. But this check isn't correct

https://github.com/Expensify/App/blob/e25e3fa13b678cf733cd64ab734d73355fc726b8/src/pages/settings/Profile/Contacts/NewContactMethodPage.tsx#L168-L174

  • loginData?.errorFields can be an empty object

  • pendingContactAction?.contactMethod isn't cleared in success data when we add a new contact method here. And in native, it's cleared here after the onClose is triggered

https://github.com/Expensify/App/blob/e25e3fa13b678cf733cd64ab734d73355fc726b8/src/libs/actions/User.ts#L442

So after the new contact method is added, it's cleared immediately.

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

We should update the check for loginData?.errorFields with isEmptyObject

if (!isEmptyObject(loginData?.errorFields) && pendingContactAction?.contactMethod) {
    User.clearContactMethod(pendingContactAction?.contactMethod);
    User.clearUnvalidatedNewContactMethodAction();
}

https://github.com/Expensify/App/blob/e25e3fa13b678cf733cd64ab734d73355fc726b8/src/pages/settings/Profile/Contacts/NewContactMethodPage.tsx#L170

Optional: We can clear contactMethod in successData here

https://github.com/Expensify/App/blob/e25e3fa13b678cf733cd64ab734d73355fc726b8/src/libs/actions/User.ts#L442

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

What alternative solutions did you explore? (Optional)

mkzie2 avatar Dec 05 '24 08:12 mkzie2

Thanks for the proposal, your RCA and solution make sense to me, I tested it and it solves the issue well, with that I believe we can go with @mkzie2's proposal. Thanks.

πŸŽ€πŸ‘€πŸŽ€ C+ reviewed

brunovjk avatar Dec 05 '24 13:12 brunovjk

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

melvin-bot[bot] avatar Dec 05 '24 13:12 melvin-bot[bot]

πŸ“£ @brunovjk πŸŽ‰ 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

melvin-bot[bot] avatar Dec 08 '24 18:12 melvin-bot[bot]

πŸ“£ @mkzie2 πŸŽ‰ 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 πŸ“–

melvin-bot[bot] avatar Dec 08 '24 18:12 melvin-bot[bot]

@mkzie2 what is your eta for the PR?

mountiny avatar Dec 08 '24 23:12 mountiny

I will raise the PR today.

mkzie2 avatar Dec 09 '24 03:12 mkzie2

@brunovjk The PR is ready.

mkzie2 avatar Dec 09 '24 08:12 mkzie2

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

melvin-bot[bot] avatar Dec 10 '24 13:12 melvin-bot[bot]

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

melvin-bot[bot] avatar Dec 10 '24 22:12 melvin-bot[bot]

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.73-8 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

  • https://github.com/Expensify/App/pull/53742

If no regressions arise, payment will be issued on 2024-12-17. :confetti_ball:

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

melvin-bot[bot] avatar Dec 10 '24 22:12 melvin-bot[bot]

@brunovjk @muttmuure @brunovjk The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

melvin-bot[bot] avatar Dec 10 '24 22:12 melvin-bot[bot]

We had a regression here, but it was promptly identified and resolved here.

brunovjk avatar Dec 16 '24 11:12 brunovjk