App icon indicating copy to clipboard operation
App copied to clipboard

[HOLD for payment 2024-12-17] Profile - Invalid second contact method is added and displayed as ready to verify.

Open IuliiaHerets opened this issue 1 year ago • 28 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.73-0 Reproducible in staging?: Yes Reproducible in production?: No If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Yes, reproducible on both If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/5320066&group_by=cases:section_id&group_order=asc&group_id=229064 Email or phone of affected tester (no customers): [email protected] Issue reported by: Applause Internal Team

Action Performed:

  1. Open the Expensify app.
  2. Tap on "Settings" and select "Profile"
  3. Open the "Contact Method" tab.
  4. Tap on "New Contact Method"
  5. Complete with an Email with an existing account.
  6. Wait for the magic code to be received and type it.
  7. Verify that an error message is displayed, showing that the account can´t be added as contact method.
  8. Close the error message and tap on the arrow on the top left corner.
  9. Verify that the account wasn´t added as second contact method.

Expected Result:

Invalid Email or Email with existing account, shouldn´t be added as secondary contact method after the error message is closed.

Actual Result:

After the user receives and closes an error message, showing that an account can´t be added as contact method, the account is added anyway and is displayed as ready to verify. The user receives a magic code to verify the account, but all the codes received are rejected.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

https://github.com/user-attachments/assets/07acfb78-0018-4ca2-9b48-89c913a2da06

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @sakluger

IuliiaHerets avatar Dec 10 '24 09:12 IuliiaHerets

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

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

Triggered auto assignment to @sakluger (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 10 '24 09:12 melvin-bot[bot]

💬 A slack conversation has been started in #expensify-open-source

melvin-bot[bot] avatar Dec 10 '24 09: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 10 '24 09:12 github-actions[bot]

Commented on the suspicious PR https://github.com/Expensify/App/pull/53462

MonilBhavsar avatar Dec 10 '24 10:12 MonilBhavsar

~The issue seems to be a bit different. I am getting a different error when I follow the steps. Also I couldn't add the contact method.~

~https://github.com/user-attachments/assets/44d22c4a-57f6-4e45-a906-e1c0c7884321~

cc: @MonilBhavsar

Edit: I was able to repro. The error is different but the issue is reproducible.

Note: This is not a regression from https://github.com/Expensify/App/pull/53462

thesahindia avatar Dec 10 '24 12:12 thesahindia

Issue still produceable after reverting the PR.

https://github.com/user-attachments/assets/22087e2e-e154-4317-a8ad-d4a3e58ca1f1

Shahidullah-Muffakir avatar Dec 10 '24 12:12 Shahidullah-Muffakir

Strange, I cannot reproduce it now on staging

MonilBhavsar avatar Dec 10 '24 13:12 MonilBhavsar

@thesahindia could you mention your steps? anything different?

MonilBhavsar avatar Dec 10 '24 13:12 MonilBhavsar

Proposal

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

When user adds an existing account as the secondary contact method, despite showing an error message, we are still adding it to the list of contact methods

What is the root cause of that problem?

we are adding the new contact method in the optimistic data here: https://github.com/Expensify/App/blob/70b92384ba20afcb031f925dac8e7f50b79c4dd0/src/libs/actions/User.ts#L413 but if error occurs we are not removing it here: https://github.com/Expensify/App/blob/70b92384ba20afcb031f925dac8e7f50b79c4dd0/src/libs/actions/User.ts#L463

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

remove the new contact method if error occurs as:

const failureData: OnyxUpdate[] = [
        {
            onyxMethod: Onyx.METHOD.MERGE,
            key: ONYXKEYS.LOGIN_LIST,
            value: {
                [contactMethod]: {
                    partnerUserID: null,
                    errorFields: {

Shahidullah-Muffakir avatar Dec 10 '24 13:12 Shahidullah-Muffakir

@thesahindia could you mention your steps? anything different?

I was able to repro on staging

I copied the steps from the video -

  1. Go to contact methods page > New contact method
  2. Use an email that belongs to an existing account
  3. Fill the magic code input
  4. Dismiss the error
  5. Press back button

thesahindia avatar Dec 10 '24 13:12 thesahindia

@Shahidullah-Muffakir, proposal looks fine. We can assign them. @MonilBhavsar, if you need a C+. I can review it.

My bad, looks like it is not on production so It should be handled by the original author and the C+.

thesahindia avatar Dec 10 '24 13:12 thesahindia

Seems like a regression from https://github.com/Expensify/App/pull/53742. Trying to verify.

thesahindia avatar Dec 10 '24 13:12 thesahindia

Confirmed. https://github.com/Expensify/App/pull/53742 caused this.

cc: @brunovjk @mkzie2

thesahindia avatar Dec 10 '24 13:12 thesahindia

I am checking the same :) I am not able to reproduced this consistently, not sure why 🤔

MonilBhavsar avatar Dec 10 '24 13:12 MonilBhavsar

I was able to repro it consistently. Also tested after reverting https://github.com/Expensify/App/pull/53742 and the problem was fixed.

thesahindia avatar Dec 10 '24 13:12 thesahindia

Thank you for checking!

MonilBhavsar avatar Dec 10 '24 14:12 MonilBhavsar

@MonilBhavsar I can create a fix now.

mkzie2 avatar Dec 10 '24 14:12 mkzie2

Appreciate it, thank you! @brunovjk are you available to review it?

MonilBhavsar avatar Dec 10 '24 15:12 MonilBhavsar

yes

brunovjk avatar Dec 10 '24 15:12 brunovjk

Thanks @thesahindia and @MonilBhavsar for dealing with it. @mkzie2 I've been investigating and haven't found a solution yet, if you do please raise a PR, I'll test it now :D

brunovjk avatar Dec 10 '24 15:12 brunovjk

@MonilBhavsar Created a draft here. Can you please assign @brunovjk here before I open this PR to prevent assigning a random C+?

mkzie2 avatar Dec 10 '24 15:12 mkzie2

Assigned

MonilBhavsar avatar Dec 10 '24 15:12 MonilBhavsar

@brunovjk The PR is ready.

prevent assigning a random C+?

@MonilBhavsar We should assign C+ to the issue to prevent that. 😅

mkzie2 avatar Dec 10 '24 15:12 mkzie2

Fixed in staging. Removing blocker label

luacmartins avatar Dec 10 '24 19:12 luacmartins

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/53864

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 (Needs manual offer from BZ)

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

@brunovjk @sakluger @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 can close this. This was handled as a regression. Thank you all for taking care of this 🙌

MonilBhavsar avatar Dec 11 '24 05:12 MonilBhavsar

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.74-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/53864

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

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

  • @brunovjk requires payment (Needs manual offer from BZ)

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