Skip to content

[Due for payment 2026-08-12] Providing magic code during verification navigates back instead of continuing forward in flow #72980

Closed
10 of 10 issues completed

Description

@m-natarajan

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.2.34-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
Expensify/Expensify Issue URL:
Issue reported by: @OlGierd03
Slack conversation (hyperlinked to channel name): #Expensify Bugs

Action Performed:

  1. Log in with a new account and do not verify with a magic code
  2. Create a workspace as admin using the green "+" button
  3. Go to the Inbox tab and create an expense in the workspace
  4. Submit and approve the expense
  5. Click the Pay button → choose Pay with business account or Mark as Paid
  6. When prompted, enter the magic code to verify the account
  7. Observe navigation after submitting the magic code

Expected Result:

After successfully providing the magic code, the user should be navigated forward to the next step in the payment flow, continuing where they left off.

Actual Result:

After entering the magic code, the app navigates backward, behaving like a backTo navigation. The user is returned to the previous screen instead of progressing, breaking the flow.

Workaround:

Unknown

Platforms:

Select the officially supported platforms where the issue was reproduced:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop
Platforms Tested: On which of our officially supported platforms was this issue tested:
  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Screen.Recording.2025-10-20.at.13.47.20.mov
Recording.1784.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Oct 20, 2025
  2. melvin-bot commented on Oct 20, 2025

    @melvin-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.

  3. OlGierd03 commented on Oct 20, 2025

    @OlGierd03
    Contributor

    Hi, I'm from Software Mansion and am familiar with the issue. I've been working on the SettlementButton and would like to work on this issue as a follow-up to #71330

  4. mountiny commented on Oct 21, 2025

    @mountiny
    Contributor

    Follow up to #69171

  5. mountiny commented on Oct 22, 2025

    @mountiny
    Contributor

    @OlGierd03 Will look into the fix

  6. melvin-bot commented on Oct 27, 2025

    @melvin-bot

    @OlGierd03 Eep! 4 days overdue now. Issues have feelings too...

  7. muttmuure commented on Oct 28, 2025

    @muttmuure
    Contributor

    Still being worked on

  8. 229 remaining items

  9. melvin-bot commented on Sep 7, 2026

    @melvin-bot

    Auto-assign attempt failed, all eligible assignees are OOO.

  10. mallenexpensify commented on Sep 8, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @aimane-chnaif due $1500 via NewDot

    @mountiny since you assigned to me after @aimane-chnaif posted their amount, I'm assuming you're 👍 with $1500. I'll leave open for a day or three then close

  11. mountiny commented on Sep 10, 2026

    @mountiny
    Contributor

    yeah looks good to me

  12. melvin-bot commented on Sep 10, 2026

    @melvin-bot

    @mallenexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!

  13. garrettmknight commented on Sep 14, 2026

    @garrettmknight
    Contributor

    $1500 approved for @aimane-chnaif

  14. aimane-chnaif commented on Sep 16, 2026

    @aimane-chnaif
    Contributor

    I found more flows where the flow stops after the magic code.

    1. Workflows > Add bank account: the next step gets popped

    Where: VerifiedBankAccountFlowEntryPoint.tsx:163-187, together with DynamicReimbursementAccountVerifyAccountPage.tsx:12.

    Repro:

    1. Log in with a new account and don't verify it with a magic code.
    2. Create a workspace, then go to Workspaces > the workspace > Workflows.
    3. Open the Payments tab.
    4. Click Add bank account.
    5. Click Connect manually (or Log into your bank).
    6. On Validate your account, enter the magic code.
    7. Expected: you land on the next bank account step. Actual: you're back on the "Connect manually / Log into your bank" screen.
    Screen.Recording.2026-09-16.at.6.22.38.PM.mov

    2. Connect existing business bank account > Add bank account: Not Found instead of the verify page

    Where: PaymentMethodList.tsx:630-634, rendered by ConnectExistingBusinessBankAccountPage.tsx:134.

    Repro (if you have such an account):

    1. As an unvalidated workspace admin with an eligible business bank account visible, go to Workflows > Payments and click Add bank account.
    2. On "Choose an existing bank account to pay expenses or add a new one.", click Add bank account.
    3. Actual: Not Found page.

    3. Works, but only by accident: Add domain

    AddDomainPage.tsx:142 now uses useVerifyAccountAndResume.
    But WORKSPACES_ADD_DOMAIN isn't in DYNAMIC_ROUTES.VERIFY_ACCOUNT.entryScreens, so the dynamic route fails validation (and logs a warning).
    It only resolves because the old static WORKSPACES_ADD_DOMAIN_VERIFY_ACCOUNT screen is still registered at the same URL.
    If that leftover screen is deleted, Add domain breaks.
    The clean fix is to add the screen to entryScreens.


    @jmusial please check ^ and validate findings.
    Should we create new sub-issues for these?

  15. jmusial commented on Sep 21, 2026

    @jmusial
    Contributor

    @aimane-chnaif yup, those cases indeed exist. Thank you for finding them!

    @MelvinBot please add a separate sub issue under this issue for each case described here and assign @aimane-chnaif myself and @mountiny

    @mountiny if you could please add labels once Melvin is done, thx

  16. MelvinBot commented on Sep 21, 2026

    @MelvinBot
    Contributor

    Created three sub-issues, one per case, all assigned to jmusial, mountiny, and aimane-chnaif. No labels applied — over to mountiny.

    Case Sub-issue
    1. Workflows > Add bank account pops the next step [Verify account] Workflows > Add bank account pops the next step after magic code verification
    2. Connect existing business bank account > Not Found [Verify account] Connect existing business bank account > Add bank account shows Not Found for unvalidated admins
    3. Add domain works only by accident [Verify account] Add domain resolves only via the leftover static verify account screen (latent)

    All three reproduce in code at 54b6817. Each issue has the mechanism, permalinked code, and action items.

    What the verification turned up

    Case 1 — confirmed, with a sharper root cause than "the step gets popped". DynamicReimbursementAccountVerifyAccountPage.tsx:9-13 is the only caller of VerifyAccountPageBase that omits navigateForwardTo. Both it and VerifiedBankAccountFlowEntryPoint.tsx sit in the same modal stack and react to the same account.validated merge: the entry point pushes the next step, then VerifyAccountPageBase.tsx:74-87 falls into handleCloseWithFallback() and pops it back off. Two navigations racing, not one bad one — so the fix deletes one of them rather than reordering.

    Case 2 — confirmed, one-line fix. SCREENS.CONNECT_EXISTING_BUSINESS_BANK_ACCOUNT_ROOT is missing from entryScreens on ROUTES.ts:166-186, so route resolution falls through to the '*' catch-all. The handler in PaymentMethodList is correct. Your line numbers were a few off at this SHA (PaymentMethodList.tsx:639-655); the issue uses the current ones.

    Case 3 — confirmed exactly as described. The Log.warn fires at getStateFromPath.ts:68-71, then the static config.ts:2206 entry rescues it. The issue lists all six registration sites to remove once entryScreens is fixed, so the cleanup lands as one PR instead of a later surprise regression.

    Verification was a static code trace, not a live repro, for all three.


    view run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions