Skip to content

[Due for payment 2026-08-27] [Verify account] Search bulk pay drops the selected payment method after magic code verification #98063

Closed

Description

@mountiny

Follow-up to the audit in issue 72980.

Problem

handleBulkPayItemSelected in Search.ts:1924-1928 navigates to DYNAMIC_ROUTES.VERIFY_ACCOUNT and then returns early:

if (!isUserValidated && item.key !== CONST.IOU.PAYMENT_TYPE.ELSEWHERE) {
    Log.info('[BulkPay] Blocking bulk pay: user is not validated, redirecting to account verification');
    Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.VERIFY_ACCOUNT.path));
    return;
}

The selected payment method is dropped. SCREENS.SEARCH.ROOT has no entry in FORWARD_TO_MAPPINGS (useDynamicForwardPath.ts:28), so DynamicVerifyAccountPage falls back to goBack. After entering the magic code the user is returned to the Search page with the selection intact but the payment never starts.

This is a payment flow, so it is the highest impact gap in the audit. @jmusial flagged it on 2026-06-10 and it was never picked up.

Solution

Use the existing useVerifyAccountAndResume hook (src/hooks/useVerifyAccountAndResume.ts) so the pending bulk pay resumes after validation, instead of relying on a forward route.

Action Items

  1. Hook the resume: call useVerifyAccountAndResume in SearchBulkActionsButton.tsx and store the selected sub-item as the payload.
  2. Thread a retry closure: pass the closure into handleBulkPayItemSelected so Search.ts triggers verification through the hook rather than calling Navigation.navigate itself.
  3. Cover both layouts: the action is called from two places, SearchBulkActionsButton.tsx:194 for wide and :238 for narrow. Both need the fix.
  4. Mirror the working precedent: MoneyReportHeaderSecondaryActions.tsx:452-456 already does exactly this for the report header.
  5. Verify: as an unvalidated user, select several expenses in Search, choose a payment method, enter the magic code, and confirm the payment continues with the method that was chosen before verification.

Specific Component to Migrate

handleBulkPayItemSelected / SearchBulkActionsButton

  • Current files: src/libs/actions/Search.ts, src/components/Search/SearchBulkActionsButton.tsx
  • Reuse: src/hooks/useVerifyAccountAndResume.ts
Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. changed the title [-][Verify account] Search bulk pay drops the selected payment method after magic code verification[/-] [+][Due for payment 2026-08-27] [Verify account] Search bulk pay drops the selected payment method after magic code verification[/+] on Aug 20, 2026
  2. melvin-bot commented on Aug 20, 2026

    @melvin-bot

    @aimane-chnaif

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.56-3 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-08-27. 🎊

    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]. If no checklist is needed for this issue, you can click: [no checklist button]

  3. 2 remaining items

  4. aimane-chnaif commented on Aug 27, 2026

    @aimane-chnaif
    Contributor

    BugZero Checklist:

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

      Link to comment: improvement

    • [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.

    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:

    Regression Test Proposal

    Test:

    1. Open app, log in as user whose account is not validated.
    2. Create new workspace with USD as currency.
    3. Navigate to Reports (Search) page.
    4. Create and then select several expenses/reports eligible for payment.
    5. Press green selected-items dropdown, choose bank-funded payment method (e.g. Pay with bank account).
    6. Verify that app opens verify-account (security code) screen instead of doing nothing.
    7. Enter magic code from email.
    8. Verify that after verification you return to Search page and payment flow continues automatically with method chosen in step 4 (KYC wall or payment confirmation appears).

    Do we agree 👍 or 👎

  5. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Aug 27, 2026
  6. melvin-bot commented on Aug 27, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  7. melvin-bot commented on Aug 27, 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
  8. mallenexpensify commented on Aug 28, 2026

    @mallenexpensify
    Contributor

    Payment Summary

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

  9. garrettmknight commented on Sep 14, 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 productionDailyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions