[HOLD for payment 2024-12-17] [$250] iOS/Android - Contact method - Contact method not displayed until re-login or cleaning cache
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:
- Open the app and log in
- Navigate to Account settings > Profile > Contact methods
- Select New contact method
- Enter an email of a new contact method
- 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
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 Owner
Current Issue Owner: @muttmuure
Triggered auto assignment to @AndrewGable (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.
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.
π¬ A slack conversation has been started in #expensify-open-source
: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:
- Identify the pull request that introduced this issue and revert it.
- Find someone who can quickly fix the issue.
- Fix the issue yourself.
Production
https://github.com/user-attachments/assets/39455658-ab12-4012-afea-10fbcce538ee
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.
: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:
- Identify the pull request that introduced this issue and revert it.
- Find someone who can quickly fix the issue.
- Fix the issue yourself.
Triggered auto assignment to @yuwenmemon (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.
π¬ A slack conversation has been started in #expensify-open-source
: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:
- Identify the pull request that introduced this issue and revert it.
- Find someone who can quickly fix the issue.
- Fix the issue yourself.
I can reproduce on staging, checking production now.
Confirmed cannot reproduce on production
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.
Job added to Upwork: https://www.upwork.com/jobs/~021864287613376718300
Triggered auto assignment to Contributor-plus team member for initial proposal review - @brunovjk (External)
I can reproduce:
v9.0.71-0 Develop
https://github.com/user-attachments/assets/f84987ce-f6cf-41f6-b0c6-83aff73634f8
Looking for proposals.
Seems like this must be either issue with the optimistic data management or issue from the backend returning wrong options
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?.errorFieldscan be an empty object -
pendingContactAction?.contactMethodisn't cleared in success data when we add a new contact method here. And in native, it's cleared here after theonCloseis 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)
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
Triggered auto assignment to @puneetlath, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
π£ @brunovjk π An offer has been automatically sent to your Upwork account for the Reviewer role π Thanks for contributing to the Expensify app!
π£ @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 π
@mkzie2 what is your eta for the PR?
I will raise the PR today.
@brunovjk The PR is ready.
β οΈ 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.
Reviewing label has been removed, please complete the "BugZero Checklist".
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:
- @brunovjk requires payment automatic offer (Reviewer)
- @mkzie2 requires payment automatic offer (Contributor)
@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]