App icon indicating copy to clipboard operation
App copied to clipboard

[$250] Merge - Inconsistent merge flow for same phone number

Open jponikarchuk opened this issue 2 months ago • 9 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: V9.2.59-1 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack: Exploratory Email or phone of affected tester (no customers): Slottwo1 [email protected] Issue reported by: Applause Internal Team Device used: Redminote 10s android 13 App Component: User Settings

Action Performed:

  1. Go to https://staging.new.expensify.com/home
  2. Tap Account → Security → Merge Account
  3. Enter the formatted phone number: +1-(201)-867-5309
  4. Tap checkmark - I understand this is not reversible
  5. Tap Next
  6. Note that the message "We don’t do merging here" / "Merge not done here" is shown
  7. Go back
  8. Enter the same phone number without formatting by removing the hyphen and bracket: +12018675309
  9. Tap Next and note the correct error: "No existing account to merge"

Expected Result:

The same number (formatted or unformatted) must direct to the same validation page. If the formatting is incorrect, the user should not be allowed to navigate to the next page. An inline error below the phone number field should appear saying "Please enter the number in correct format", and only after fixing it, navigation should continue. Both formats should ultimately show the same final message: "No existing account to merge", since the number used is the same.

Actual Result:

For the same phone number, tapping Next takes the user to different pages: Formatted number → Shows "Merge not done here" Unformatted number → Shows "No existing account to merge" correctly

Workaround:

Unknown

Platforms:

  • [x] Android: App
  • [x] Android: mWeb Chrome
  • [ ] iOS: App
  • [ ] iOS: mWeb Safari
  • [ ] iOS: mWeb Chrome
  • [x] Windows: Chrome
  • [ ] MacOS: Chrome / Safari
  • [ ] MacOS: Desktop

Screenshots/Videos

https://github.com/user-attachments/assets/a27afa5d-c6ef-4209-a154-99747547f26c

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021993335432097438954
  • Upwork Job ID: 1993335432097438954
  • Last Price Increase: 2025-11-25
Issue OwnerCurrent Issue Owner: @muttmuure

jponikarchuk avatar Nov 17 '25 12:11 jponikarchuk

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 Nov 17 '25 12:11 melvin-bot[bot]

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

melvin-bot[bot] avatar Nov 25 '25 15:11 melvin-bot[bot]

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

melvin-bot[bot] avatar Nov 25 '25 15:11 melvin-bot[bot]

Proposal

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

For the same phone number, tapping Next takes the user to different pages: Formatted number → Shows "Merge not done here" Unformatted number → Shows "No existing account to merge" correctly

What is the root cause of that problem?

We don't convert the phone number to the correct format before triggering GetValidateCodeForAccountMerge API, so BE returns a different error code for each format

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

we should parse the phone number to the correct format like what we did before calling OpenReport.

Update requestValidationCodeForAccountMerge

function requestValidationCodeForAccountMerge(email: string, validateCodeResent = false, countryCode: number = CONST.DEFAULT_COUNTRY_CODE) {
    // Normalize the email/phone input similar to how it's done in filterOptions
    const parsedPhoneNumber = parsePhoneNumber(appendCountryCode(Str.removeSMSDomain(email), countryCode));
    const normalizedEmail = parsedPhoneNumber.possible && parsedPhoneNumber.number?.e164 ? parsedPhoneNumber.number.e164 : email.toLowerCase();
...

in AccountValidatePage, update this line to

requestValidationCodeForAccountMerge(email, true, countryCode);

What alternative solutions did you explore? (Optional)

We also can do the same for mergeWithValidateCodeAction

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

paulnjs avatar Nov 25 '25 16:11 paulnjs

@paulnjs's proposal looks good to me

🎀👀🎀 C+ reviewed

dukenv0307 avatar Nov 26 '25 03:11 dukenv0307

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

melvin-bot[bot] avatar Nov 26 '25 03:11 melvin-bot[bot]

📣 @paulnjs You have been assigned to this job! Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻 Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs! Keep in mind: Code of Conduct | Contributing 📖

melvin-bot[bot] avatar Nov 26 '25 17:11 melvin-bot[bot]

@muttmuure, please remove the Reviewing label and bump to Daily as payment is due

dukenv0307 avatar Dec 18 '25 10:12 dukenv0307

Awaiting payment still

Julesssss avatar Dec 22 '25 21:12 Julesssss