Skip to content

[Due for payment 2026-10-16] [Verify account] Workflows > Add bank account pops the next step after magic code verification #101748

Closed

Description

@MelvinBot

Follow-up to the audit in issue 72980.

Problem

As an unvalidated workspace admin, going to Workflows > Payments > Add bank account > Connect manually (or Log into your bank) and entering the magic code puts you back on the "Connect manually / Log into your bank" screen instead of the next bank account step.

DynamicReimbursementAccountVerifyAccountPage.tsx:9-13 is the only caller of VerifyAccountPageBase that does not pass navigateForwardTo:

function DynamicReimbursementAccountVerifyAccountPage() {
    const backPath = useDynamicBackPath(DYNAMIC_ROUTES.BANK_ACCOUNT_VERIFY_ACCOUNT.path);

    return <VerifyAccountPageBase navigateBackTo={backPath} />;
}

Every sibling computes and passes it — DynamicAddBankAccountVerifyAccountPage.tsx:26-38, settings/DynamicVerifyAccountPage.tsx:21, Travel/DynamicVerifyAccountPage.tsx:38-43.

That omission creates a race. The verify account screen and VerifiedBankAccountFlowEntryPoint.tsx live in the same modal stack, so both stay mounted and both react to the same account.validated Onyx merge:

  1. The entry point's effect at VerifiedBankAccountFlowEntryPoint.tsx:163-187 calls prepareNextStep(), which pushes the real next step.
  2. VerifyAccountPageBase's own effect at VerifyAccountPageBase.tsx:74-87 finds no navigateForwardTo, so it falls into handleCloseWithFallback() → Navigation.goBack(navigateBackTo), which pops back to the entry path — taking the freshly pushed step with it.

Solution

Give the verify account page ownership of the forward transition so only one place navigates after validation.

Action Items

  1. Pass navigateForwardTo: in DynamicReimbursementAccountVerifyAccountPage.tsx, read ONYXKEYS.REIMBURSEMENT_ACCOUNT_OPTION_PRESSED plus the policy/currency context and compute the forward route the same way prepareNextStep / handleConnectManually / handleConnectPlaid do (MANUAL → the USD or non-USD setup step, PLAID → the Plaid step). Mirror DynamicAddBankAccountVerifyAccountPage.tsx:26-39.
  2. Remove the duplicate navigation: once the verify page forwards, drop the Onyx-driven effect at VerifiedBankAccountFlowEntryPoint.tsx:163-187 or convert it to the onValidationSuccess callback VerifyAccountPageBase already exposes. Two post-validation Navigation calls is the bug; deleting one removes it structurally rather than reordering it.
  3. Cover both branches: verify Connect manually and Log into your bank separately — they take different forward routes.
  4. Verify: as an unvalidated admin, Workflows > Payments > Add bank account > Connect manually > enter the magic code, and confirm you land on the next bank account step and stay there.

Specific Component to Migrate

DynamicReimbursementAccountVerifyAccountPage

  • Current files: src/pages/ReimbursementAccount/DynamicReimbursementAccountVerifyAccountPage.tsx, src/pages/ReimbursementAccount/VerifiedBankAccountFlowEntryPoint.tsx
  • Reuse: src/pages/settings/Wallet/DynamicAddBankAccountVerifyAccountPage.tsx, src/pages/settings/VerifyAccountPageBase.tsx

Repro video

Screen.Recording.2026-09-16.at.6.22.38.PM.mov
Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. added and removed
    ReviewingHas a PR in review
    on Oct 9, 2026
  2. changed the title [-][Verify account] Workflows > Add bank account pops the next step after magic code verification[/-] [+][Due for payment 2026-10-16] [Verify account] Workflows > Add bank account pops the next step after magic code verification[/+] on Oct 9, 2026
  3. melvin-bot commented on Oct 9, 2026

    @melvin-bot

    @aimane-chnaif

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

    If no regressions arise, payment will be issued on 2026-10-16. 🎊

    The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ 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]. If no checklist is needed for this issue, you can click: [no checklist button]

  4. aimane-chnaif commented on Oct 11, 2026

    @aimane-chnaif
    Contributor

    This is sub-issue of project #72980 which was before Sep 19, so the payment will be $250

    Contributor+ Checklist:

    • [Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to the comment on the PR:
      Link to the comment on the Issue:

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion:

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    Regression Test Proposal

    Test:

    Scenario 1: Connect manually on a USD workspace

    1. Open app as an admin with an unvalidated account on a USD workspace with no bank account
    2. Navigate to Workspace > Workflows > Payments > Add bank account
    3. Tap "Connect manually"
    4. Verify that the "Validate your account" magic code screen opens
    5. Enter the magic code
    6. Verify that you land on the Country step of the bank account setup

    Scenario 2: Log into your bank on a USD workspace

    1. Open app as an admin with an unvalidated account on a USD workspace with no bank account
    2. Navigate to Workspace > Workflows > Payments > Add bank account
    3. Tap "Log into your bank"
    4. Enter the magic code
    5. Verify that you land on the Country step of the bank account setup
    6. Wait a few seconds
    7. Verify that you stay on the Country step and are not sent back to the "Add bank account" screen
    8. Continue past the Country step
    9. Verify that the bank info step offers the Plaid login

    Scenario 3: Connect manually on a non-USD workspace

    1. Open app as an admin with an unvalidated account on a workspace whose default currency is not USD (e.g. EUR) and which has no bank account
    2. Navigate to Workspace > Workflows > Payments > Add bank account
    3. Verify that only "Connect manually" is shown
    4. Tap "Connect manually" and enter the magic code
    5. Verify that you land on the "Currency and country" step

    Scenario 4: Admin who is already validated

    1. Open app as an admin with a validated account on a USD workspace with no bank account
    2. Navigate to Workspace > Workflows > Payments > Add bank account
    3. Tap "Connect manually"
    4. Verify that the magic code screen is skipped and you land directly on the Country step
    5. Go back and tap "Log into your bank"
    6. Verify that you land directly on the Country step

    Do we agree 👍 or 👎

  5. melvin-bot commented on Oct 12, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  6. melvin-bot commented on Oct 15, 2026

    @melvin-bot

    Payment Summary

    Resolving PRs:

    BugZero Checklist (@mallenexpensify)

    • I have confirmed assignees, roles, and Upwork contracts look correct
    • I have paid out Upwork contracts / manual NewDot requests
    • [BugZero Assignee] I have created a GH issue for creating/updating the regression test once above steps have been agreed upon
  7. mallenexpensify commented on Oct 17, 2026

    @mallenexpensify
    Contributor

    Payment Summary

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

    Follow-up to the audit in #72980 (comment).

    Paying $250 cuz of the above.

  8. mallenexpensify commented on Oct 18, 2026

    @mallenexpensify
    Contributor

    @aimane-chnaif both updated.

  9. garrettmknight commented on Oct 30, 2026

    @garrettmknight
    Contributor

    $250 approved for @aimane-chnaif

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 productionTaskWeeklyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions