Skip to content

Locked BA - After going online and clicking Pay Locked BA modal is not shown, failed attempt #98998

Closed

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: 9.4.56-2
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/folder/54018437/test-cases/98913455
Email or phone of affected tester (no customers): applausetester+lockedba@applause.expensifail.com
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: MacBook Air 26.5.2 Chrome
App Component: Money Requests

Action Performed:

  1. Sign in to ND with a applausetester+lockedba@applause.expensifail.com account
  2. Create a manual expense in the workspace, submit and approve it
  3. Open the expense details, go offline
  4. Click green Pay button and select Pay with bank account
  5. Click Cancel on the Locked bank account modal
  6. Go online and repeat step 4

Expected Result:

Locked bank account modal is displayed

Actual Result:

After going online and clicking Pay "Locked BA" modal is not shown. "Paid with bank account xxxx" system message appears with an error "The selected bank account isn't a valid withdrawal account for you. Please choose a different account to pay from."

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome Safari

Screenshots/Videos

Bug7237540_1787165296876.Locked_BA.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Julia Ponikarchuk
Bug ID: 7237540

Activity

  1. applause-bot commented on Aug 19, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/1540f96c9ed2d6fe8674fe035ed07cb21dd923245fcb0cb8f1a6746bd86e24e7

  2. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Aug 19, 2026
  3. github-actions commented on Aug 19, 2026

    @github-actions
    Contributor

    👋 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.
  4. melvin-bot commented on Aug 19, 2026

    @melvin-bot

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

  5. melvin-bot commented on Aug 19, 2026

    @melvin-bot

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

  6. changed the title [-]Locked BA-After going online and clicking Pay Locked BA modal is not shown, failed attempt[/-] [+]Locked BA - After going online and clicking Pay Locked BA modal is not shown, failed attempt[/+] on Aug 19, 2026
  7. MelvinBot commented on Aug 19, 2026

    @MelvinBot
    Contributor

    🔍 Investigation Summary

    Classification: Undetermined (leaning Frontend/data) — no App PR confidently identified
    Causing PR: None identified with sufficient confidence (see ruled-out candidates below)
    Related Issues: N/A

    Recommendation: NEEDS INVESTIGATION

    The client-side guard that should surface the "Locked bank account" modal lives in SettlementButton and is unchanged since 2026-08-10 (already on production), yet the bug only reproduces on staging — so I could not pin it to a specific PR in this deploy. Keeping the label and flagging for the Payments team.

    Assigned: none (no causing PR at medium+ confidence)
    Labels: No changes. DeployBlockerCash kept (issue does not reproduce on production, and no clear App PR could be blamed — erring on the side of keeping the blocker).

    📋 Detailed Analysis

    Root Cause (hypothesis)

    The Pay button on the expense-details header renders SettlementButton (via MoneyReportHeaderPrimaryAction/PayPrimaryAction). When "Pay with bank account" is chosen, runPaymentAction → checkForNecessaryAction → checkForPostValidationBlockers gates the payment. The locked-BA gate is:

    const isBankAccountLocked = policy?.achAccount?.state === CONST.BANK_ACCOUNT.STATE.LOCKED; // L197
    ...
    if (isBankAccountLocked) { showConfirmModal(... 'bankAccount.lockedBankAccount' ...); return true; } // L206
    
    • Offline (step 4): the cached policy still has achAccount.state === LOCKED, so the gate fires and the modal is shown correctly.
    • Online (step 6): the modal is not shown and the payment is dispatched, then the backend rejects it ("The selected bank account isn't a valid withdrawal account…"). For the gate to stop firing, policy.achAccount.state must no longer equal LOCKED after the app reconnects/refetches.

    So the regression most likely comes from what the app receives/merges for policy.achAccount when going back online, not from the gate logic itself (which is identical to production).

    Verification

    • Affected decision path: src/components/SettlementButton/index.tsx L197–L262 (isBankAccountLocked, checkForPostValidationBlockers, checkForNecessaryAction, runPaymentAction).
    • git/GitHub history: last change to SettlementButton/index.tsx was 2026-08-10, i.e. it shipped in a prior (production) release. No PR in the 9.4.56 StagingDeployCash touches this file, useVerifyAccountAndResume.ts, or the isBankAccountLocked / achAccount state path.

    Candidate PRs examined and ruled out

    Why NEEDS INVESTIGATION (not a revert)

    The user-facing gate is App code and unchanged from production, so a straight revert has no obvious target. The staging-only reproduction points at a change in the data returned/merged for the locked withdrawal account on reconnect. This needs eyes from the Payments/withdrawal-account owners to confirm whether the offending change is in the app's online data merge or in the API response for the locked account. Because the issue does not reproduce on production, the DeployBlockerCash label is intentionally kept.

    Suggested next steps for the assignee

    1. On staging, reproduce and inspect policy.<id>.achAccount.state in Onyx immediately after going online — confirm whether it flips away from LOCKED.
    2. If it flips, bisect the source of the refreshed policy data (OpenReport/reconnect payload vs. client merge). If the API now omits the locked-account state, this is a backend issue and should be re-classified.
  8. Beamanator commented on Aug 19, 2026

    @Beamanator
    Contributor

    Investigation update

    What the evidence shows

    The expected behavior is clear: a locked business bank account must block every payment entry point and show the locked-account modal; it must not submit PayMoneyRequest.

    • #96624 is an open, closely related report: payment could proceed from another surface despite the bank account being locked. It reproduced on both staging and production in 9.4.41-0, so it supports a pre-existing cross-surface guard gap rather than a new staging-only regression.
    • #95026 established the same contract and regression test: lock the account, attempt payment, and verify the locked-account modal appears. Its App fix (#95063) was deployed; that issue is still open only for administrative/payment follow-up.
    • #91300 separately defines the locked-account status UX ("requires attention" / unlock path).

    App code and log evidence

    The report-details payment path still goes through SettlementButton's locked-account guard. The file is byte-for-byte unchanged between production 9.4.55-4 and the reported staging build 9.4.56-2; there is no release diff that bypasses this guard.

    Staging logs show that the attempted action did reach the backend: PayMoneyRequest was rejected with the business error "Payer does not own a valid withdrawal bank account with that ID" on 9.4.56-2. Crucially, the same error is also present in staging logs from 9.4.55-3, before this issue's release range. That rules out 9.4.56-2 as the introduction point, but does not prove why the client allowed the request.

    The available logs contain request metadata and the backend rejection, but not the returned Onyx policy payload. The remaining question is whether, after reconnect, the client received:

    1. policy.achAccount.state !== LOCKED (or a missing/wrong policy), while the backend still rejects the selected withdrawal account — a staging data/server consistency issue; or
    2. state === LOCKED, but a payment entry point still submitted — an App guard defect, likely related to [Exploratory] Bank-Expenses can be paid using a locked bank account from the Spend page #96624.

    Recommendation

    Do not close this as an invalid expectation, and do not ship a speculative App change or revert. Reclassify it as a pre-existing staging payment-state investigation until we capture the policy/bank-account snapshot around reconnect. If the account is still LOCKED, link this to #96624 and fix the bypass; if it is not, route it to the team that owns the policy/bank-account response consistency.

    @MelvinBot please investigate this independently, focusing on the policy and bank-account data delivered immediately after reconnect for the reported staging test account, and reconcile it with the backend's withdrawal-account rejection.

    🤖 Posted by Codex, an AI coding agent acting for @Beamanator.

  9. MelvinBot commented on Aug 19, 2026

    @MelvinBot
    Contributor

    Independent investigation — reconnect data vs. backend rejection

    Conclusion: this is most consistent with your scenario 1 (a data/consistency issue where the reconnected client no longer sees achAccount.state === LOCKED), not an App guard defect like Expensify/App#96624. The report-details guard exists, is on the online path, and its only input is policy.achAccount.state, which the App never writes during reconnect. I couldn't capture the actual reconnect payload here, so the final attribution is medium confidence — but the code rules out the guard-defect branch for this specific surface.

    I agree with your recommendation: don't close as invalid, don't ship a speculative App change or revert. Keep it as a pre-existing payment-state investigation and route the confirming step to the team that owns the policy/bank-account response.

    Why it's not the #96624 guard-defect branch

    #96624 is a guard absence on the Spend surface. The report-details Pay path here is different — the locked-account guard is present and fires on the online path, so "modal offline, no modal online" cannot be explained by a missing guard on this surface. It can only be explained by the guard's input (achAccount.state) no longer being LOCKED after reconnect.

    Code evidence (App @ 3dc2897)
    • The guard's sole input is policy.achAccount.state: SettlementButton/index.tsx:197 → :206 shows the locked-BA modal and blocks payment.
    • It is reached on the online path: checkForNecessaryAction returns checkForPostValidationBlockers() at :262, and every Pay entry (including VBBA) routes through runPaymentAction (:265, :342, :588).
    • policy is a reactive usePolicy read and the guard functions are recomputed every render (no memoization/stale closure), so the second (online) click evaluates the current achAccount.state. The offline vs. online code path is identical.
    • The App has no client-side write to achAccount during reconnect: grep achAccount in src/libs/actions/Report.ts (OpenReport) and src/libs/actions/App.ts (ReconnectApp) → zero matches. Those flows only Onyx.merge whatever onyxData the backend returns into the policy key. The only App-side achAccount writes are unrelated bank-setup flows (Policy.ts reimbursement setup, resetUSD/NonUSDBankAccount), none triggered by opening a report or reconnecting.

    Given Onyx.merge deep-merge semantics, the reconnect outcome is decided entirely by the backend payload: omit achAccount (or omit state) → LOCKED persists and the modal keeps showing; include achAccount with a non-LOCKED state → LOCKED is overwritten, the guard stops firing, PayMoneyRequest is dispatched and rejected. The reported behavior matches the last case.

    The decisive next step (needs internal eyes)

    The one piece that settles it is the ReconnectApp / OpenReport / OpenPolicy response payload for a LOCKED business bank account: does it still carry achAccount.state === "LOCKED"? That's a backend response-shape question, so a separate internal investigation is needed — VictoriaLogs holds the request metadata and the PayMoneyRequest rejection, but not the returned Onyx policy payload. To capture it directly: reproduce on staging with applausetester+lockedba@applause.expensifail.com and read policy.<id>.achAccount.state in Onyx (or a network trace of the reconnect response) immediately after going online.

    • If state is not LOCKED after reconnect → confirmed data/consistency issue; route to the policy/bank-account response owners. (No App change.)
    • If state is still LOCKED yet payment submitted → that would contradict this code trace and warrant re-opening the App-guard angle.

    Since confirmation and any fix live outside the App repo, I'm not proposing an App code change or revert. #96624 remains a genuinely separate Spend-surface bypass and shouldn't be conflated with this report-details path.


    view run

  10. 4 remaining items

  11. melvin-bot commented on Aug 25, 2026

    @melvin-bot

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

  12. melvin-bot commented on Aug 27, 2026

    @melvin-bot

    @tylerkaraszewski Still overdue 6 days?! Let's take care of this!

  13. melvin-bot commented on Aug 31, 2026

    @melvin-bot

    @tylerkaraszewski 10 days overdue. I'm getting more depressed than Marvin.

  14. deleted a comment from MelvinBot on Sep 1, 2026
  15. melvin-bot commented on Sep 2, 2026

    @melvin-bot

    @tylerkaraszewski this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

  16. melvin-bot commented on Sep 4, 2026

    @melvin-bot

    @tylerkaraszewski Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  17. melvin-bot commented on Sep 5, 2026

    @melvin-bot

    @tylerkaraszewski Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  18. melvin-bot commented on Sep 8, 2026

    @melvin-bot

    @tylerkaraszewski Still overdue 6 days?! Let's take care of this!

  19. tylerkaraszewski commented on Sep 9, 2026

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2Engineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions