You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[$175] Expense report - No cancel payment option after pay with business bank account #104535
Version Number: 9.5.15-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:#102489 Email or phone of affected tester (no customers):applausetester+dk65@applause.expensifail.com Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: Windows 11 Chrome App Component: Money Requests
Action Performed:
Preconditions:
Account A invite Account B to workspace as member
Add a bank account to worksace: 1111
Add a reimbursable bank account to Account B Wallet: 0000
changed the title [-]Expense report- No cancel payment option after pay with business bank account[/-][+]Expense report - No cancel payment option after pay with business bank account[/+]on Oct 21, 2026
Root Cause: This looks like expected behavior, not a regression. The repro pays with the staging test business bank account (1111). The backend never marks test bank account payments as cancellable, so Cancel payment stays hidden. Since Fix cancel payment showing after the NACHA cutoff has passed (merged 2026-09-21), the App shows Cancel payment for a bank-paid expense report only when the server sends canCancelReimbursement: true (ReportSecondaryActionUtils.ts:505-506).
Recommended Fix: No App code change. Close this issue as expected behavior, or ask QA to retest with a real, verified bank account and a non-fast ACH payment. If Cancel payment is still missing in that case, the fix is on the backend, and an internal engineer needs to look into it.
Investigation details
Why the option is hidden
For expense reports, isCancelPaymentAction returns true early only for "paid elsewhere" payments (L498-503). For bank payments it relies entirely on report.canCancelReimbursement.
Account A is the payer, so it passes the payer check. The caller adds no other conditions (L1125-1127).
The pay flow never sets canCancelReimbursement (PayMoneyRequest.ts:335-391). The value comes only from the server.
Why this is intended
PR Fix cancel payment showing after the NACHA cutoff has passed #97556 removed the old client-side guess (show the option before the daily ACH cutoff). That guess offered Cancel payment for payments the backend couldn't cancel, and clicking it showed "Auth CancelReimbursement returned an error".
The same PR flipped the unit test for "bank payment in APPROVED + REIMBURSED state" from showing the option to hiding it.
The PR's test steps say: with a test bank account, the backend "skips the reimbursements row… so canCancel is always false and the option stays hidden for every bank payment" (comment).
Fast ACH payments credit the employee right away, so they can never be cancelled, even with a real account.
For a real, cancellable payment, the option appears right away only if the pay response includes canCancelReimbursement. A reviewer flagged that it was missing from that response (comment). A backend change to add it was opened, but I couldn't confirm it has been deployed. If it hasn't, the payer has to reopen the report to see the option.
Not verified: I didn't reproduce this in a browser, because the flow needs a verified business bank account and a wallet bank account.
Next Steps: Reply with @MelvinBot <your feedback> to refine this analysis.
changed the title [-]Expense report - No cancel payment option after pay with business bank account[/-][+][$175] Expense report - No cancel payment option after pay with business bank account[/+]on Oct 21, 2026
Please re-state the problem that we are trying to solve in this issue.
After paying an expense report with a business bank account, the "Cancel payment" option no longer appears in the More menu, even though the payment is a standard ACH transfer that should be cancellable.
What is the root cause of that problem?
In src/libs/ReportSecondaryActionUtils.ts, isCancelPaymentAction (line 450) ends with return !!report.canCancelReimbursement; (line 506) as the final gate for bank-account payments. canCancelReimbursement is a server-sent field that was only wired through the day before this issue was filed (PR #102489). When the server omits the field for a standard ACH transfer, !!undefined evaluates to false, silently suppressing the Cancel Payment option for every such report. The comment on line 505 shows the field's real purpose: only Auth knows whether a queued/in-flight reimbursement can still be cancelled, because fast ACH posts the credit right away.
What changes do you think we should make in order to solve the problem?
Change the final gate from opt-in to opt-out, one line:
return report.canCancelReimbursement !== false;
An absent/undefined field means cancellable (the safe default for a standard ACH transfer that has not posted); only an explicit false from the server (the fast-ACH case the field was designed for) suppresses the button. The mirrored pay gate above (lines 483-487) and the paid-elsewhere branch (lines 500-503) are untouched.
What alternative solutions did you explore?
Backend-only fix: ensure Auth always sends canCancelReimbursement: true for standard ACH. Valid long-term, but the frontend should not break when a server field is absent - the opt-out read is robust to both.
I will verify: reproduce the issue flow (expense submitted, approved, paid with a business bank account) and confirm the Cancel Payment option renders again; confirm it stays hidden when the server explicitly returns canCancelReimbursement: false; confirm the existing cancel-payment flow and isWaitingForCancelledReimbursement state are unchanged; and run the ReportSecondaryActionUtils unit tests.
Please re-state the problem that we are trying to solve in this issue.
When paying an expense report using a business bank account, clicking the "More" overflow menu on the report immediately after payment does not display the "Cancel payment" option.
What is the root cause of that problem?
In src/libs/ReportSecondaryActionUtils.ts:494-508: isCancelPaymentAction checks whether a report payment can be cancelled:
For business bank account payments (VBBA), isPaidViaBankAccount is true. The check therefore falls through to report.canCancelReimbursement.
2. In src/libs/actions/IOU/PayMoneyRequest.ts:334-354:
When payMoneyRequest executes, optimisticData merges:
However, it omits canCancelReimbursement: true for bank payments (paymentMethodType === CONST.IOU.PAYMENT_TYPE.VBBA).
Because canCancelReimbursement is not optimistically set to true, report.canCancelReimbursement evaluates to false/undefined in isCancelPaymentAction, hiding the "Cancel payment" option from the overflow menu.
What changes do you think we should make in order to solve the problem?
In src/libs/actions/IOU/PayMoneyRequest.ts:337:
Include canCancelReimbursement: isPaidViaBankAccount (or paymentMethodType === CONST.IOU.PAYMENT_TYPE.VBBA) in the optimistic report update:
This ensures that immediately upon initiating a business bank account payment, the report state reflects that the reimbursement is pending and can be cancelled before settlement.
What alternative solutions did you explore? (Optional)
Deriving bank payment cancellation solely from isProcessingReport: Rejected because canCancelReimbursement is the single source of truth across both optimistic states and backend responses for ACH reimbursement cancellation.
Testing
In a workspace with an active business bank account, approve a member's submitted expense report.
Pay the expense report using the business bank account.
Click on the "More" overflow menu in the report header.
Verify that the "Cancel payment" option is visible and selectable.
Click "Cancel payment" and verify the cancellation modal prompts and cancels the pending reimbursement.
@mukhrr it depends on the dates the reimbursement was started and tried to cancel, no? Or was this due to the fake reimbursements never being able to be cancelled?
[@mukhrr](https://github.com/mukhrr) it depends on the dates the reimbursement was started and tried to cancel, no? Or was this due to the fake reimbursements never being able to be cancelled?
@iwiznia it's fake reimbursement case. seems the same with this
Please re-state the problem that we are trying to solve in this issue.
QA paid an approved expense report from a workspace with a business bank account (1111) to a member's reimbursable wallet bank account (0000) on staging. Afterward, the report's "More" menu has no "Cancel payment" option. QA expected the option to appear. We need to decide whether this is a real regression, and what, if anything, to change.
What is the root cause of that problem?
This is most likely expected behavior, not an App regression.
PR Fix cancel payment showing after the NACHA cutoff has passed #97556 ("Fix cancel payment showing after the NACHA cutoff has passed") removed the client-side guess that showed Cancel payment before the daily ACH cutoff. That guess offered the option for payments the backend could not cancel, and clicking it produced "Auth CancelReimbursement returned an error".
Since that PR, isCancelPaymentAction in src/libs/ReportSecondaryActionUtils.ts (around lines 494-507) returns true early only for "paid elsewhere" payments. For bank payments it ends with return !!report.canCancelReimbursement;. Only the server knows whether an in-flight reimbursement can still be cancelled.
The repro uses the staging test business bank account. As the PR Fix cancel payment showing after the NACHA cutoff has passed #97556 test notes and mukhrr confirmed in this thread, the backend skips the reimbursements row for fake or test bank accounts. canCancelReimbursement is therefore never true, and the option stays hidden. Fast ACH payments also credit the employee immediately and can never be cancelled.
bonnhatnguyen's proposal sets canCancelReimbursement optimistically to true for all VBBA payments. That has the same flaw. Fast ACH, test accounts and post-cutoff payments are not cancellable, so the option would flash visible and then disappear when the server response arrives, or error on click.
What changes do you think we should make in order to solve the problem?
No App code change is needed for the reported scenario. Recommended actions:
Close the issue as expected behavior. Add a note for QA that Cancel payment is not available for test or fake bank account reimbursements.
Optional follow-up for a real, cancellable payment. PayMoneyRequest.ts (around lines 940-947) does not re-fetch the report after paying. If the PayMoneyRequest response lacks canCancelReimbursement, the payer must reopen the report to see the option.
Confirm with the backend team (@iwiznia) that the pay response, or a follow-up Onyx update, includes canCancelReimbursement.
If it does not, fix it on the backend by adding the field to the response. As a fallback, call openReport or a report refresh after a successful bank payment.
Do not set the field optimistically on the client, because the client cannot know whether Auth will allow cancellation.
Keep the existing unit test in tests/unit/ReportSecondaryActionUtilsTest.ts. It asserts that a bank payment in APPROVED + REIMBURSED state without canCancelReimbursement: true hides the option. Optionally add a test that canCancelReimbursement: true shows it.
What alternative solutions did you explore? (Optional)
canCancelReimbursement !== false (opt-out default): rejected. It reintroduces the pre-Fix cancel payment showing after the NACHA cutoff has passed #97556 behavior of offering a cancel action that fails server-side, and ignores that fake and fast-ACH payments are never cancellable.
Optimistically setting canCancelReimbursement: true in payMoneyRequest for VBBA: rejected. The client lacks the information (NACHA cutoff, fast ACH, test account), so the option would flicker or error.
Reproduce the issue steps with the staging test bank account. Confirm Cancel payment stays hidden, which is the expected outcome.
With a real verified business bank account and a standard (non-fast) ACH reimbursement, pay an approved report. Confirm the server sends canCancelReimbursement: true, and that Cancel payment appears in More, immediately or after reopening the report.
If a pay-response or re-fetch fix is made, verify the option appears right after paying without reopening the report.
📣 @Abdallah-1551! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
Activity
applause-bot commentedon Oct 21, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/9abfbd2e6543f5f7e5fe02996775ce624f34c643359231e1abab63869cf409f3
[-]Expense report- No cancel payment option after pay with business bank account[/-][+]Expense report - No cancel payment option after pay with business bank account[/+]MelvinBot commentedon Oct 21, 2026
Issue Analysis
Root Cause: This looks like expected behavior, not a regression. The repro pays with the staging test business bank account (
1111). The backend never marks test bank account payments as cancellable, so Cancel payment stays hidden. Since Fix cancel payment showing after the NACHA cutoff has passed (merged 2026-09-21), the App shows Cancel payment for a bank-paid expense report only when the server sendscanCancelReimbursement: true(ReportSecondaryActionUtils.ts:505-506).Recommended Fix: No App code change. Close this issue as expected behavior, or ask QA to retest with a real, verified bank account and a non-fast ACH payment. If Cancel payment is still missing in that case, the fix is on the backend, and an internal engineer needs to look into it.
Investigation details
Why the option is hidden
isCancelPaymentActionreturnstrueearly only for "paid elsewhere" payments (L498-503). For bank payments it relies entirely onreport.canCancelReimbursement.canCancelReimbursement(PayMoneyRequest.ts:335-391). The value comes only from the server.Why this is intended
reimbursementsrow… socanCancelis always false and the option stays hidden for every bank payment" (comment).Possible gap to watch (separate from this report)
PayMoneyRequest.ts:940-947).canCancelReimbursement. A reviewer flagged that it was missing from that response (comment). A backend change to add it was opened, but I couldn't confirm it has been deployed. If it hasn't, the payer has to reopen the report to see the option.Not verified: I didn't reproduce this in a browser, because the flow needs a verified business bank account and a wallet bank account.
Next Steps: Reply with
@MelvinBot <your feedback>to refine this analysis.melvin-bot commentedon Oct 21, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @DylanDylann (
External)[-]Expense report - No cancel payment option after pay with business bank account[/-][+][$175] Expense report - No cancel payment option after pay with business bank account[/+]melvin-bot commentedon Oct 21, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022112817903509237254
camesenin commentedon Oct 21, 2026
melvin-bot commentedon Oct 21, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
j3ffffff commentedon Oct 21, 2026
mukhrr commentedon Oct 21, 2026
I think this is expected. #97556 (comment) cc @iwiznia
khizzcr7 commentedon Oct 21, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
After paying an expense report with a business bank account, the "Cancel payment" option no longer appears in the More menu, even though the payment is a standard ACH transfer that should be cancellable.
What is the root cause of that problem?
In
src/libs/ReportSecondaryActionUtils.ts,isCancelPaymentAction(line 450) ends withreturn !!report.canCancelReimbursement;(line 506) as the final gate for bank-account payments.canCancelReimbursementis a server-sent field that was only wired through the day before this issue was filed (PR #102489). When the server omits the field for a standard ACH transfer,!!undefinedevaluates tofalse, silently suppressing the Cancel Payment option for every such report. The comment on line 505 shows the field's real purpose: only Auth knows whether a queued/in-flight reimbursement can still be cancelled, because fast ACH posts the credit right away.What changes do you think we should make in order to solve the problem?
Change the final gate from opt-in to opt-out, one line:
An absent/undefined field means cancellable (the safe default for a standard ACH transfer that has not posted); only an explicit
falsefrom the server (the fast-ACH case the field was designed for) suppresses the button. The mirrored pay gate above (lines 483-487) and the paid-elsewhere branch (lines 500-503) are untouched.What alternative solutions did you explore?
Backend-only fix: ensure Auth always sends
canCancelReimbursement: truefor standard ACH. Valid long-term, but the frontend should not break when a server field is absent - the opt-out read is robust to both.I will verify: reproduce the issue flow (expense submitted, approved, paid with a business bank account) and confirm the Cancel Payment option renders again; confirm it stays hidden when the server explicitly returns
canCancelReimbursement: false; confirm the existing cancel-payment flow andisWaitingForCancelledReimbursementstate are unchanged; and run theReportSecondaryActionUtilsunit tests.bonnhatnguyen commentedon Oct 21, 2026
Contributor details
Your Expensify account email: bonnhatnguyen0@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~0139ed4098bdc50182
Proposal
Please re-state the problem that we are trying to solve in this issue.
When paying an expense report using a business bank account, clicking the "More" overflow menu on the report immediately after payment does not display the "Cancel payment" option.
What is the root cause of that problem?
src/libs/ReportSecondaryActionUtils.ts:494-508:isCancelPaymentActionchecks whether a report payment can be cancelled:For business bank account payments (VBBA),
isPaidViaBankAccountistrue. The check therefore falls through toreport.canCancelReimbursement.2. In
src/libs/actions/IOU/PayMoneyRequest.ts:334-354:When
payMoneyRequestexecutes,optimisticDatamerges:However, it omits
canCancelReimbursement: truefor bank payments (paymentMethodType === CONST.IOU.PAYMENT_TYPE.VBBA).Because
canCancelReimbursementis not optimistically set totrue,report.canCancelReimbursementevaluates tofalse/undefinedinisCancelPaymentAction, hiding the "Cancel payment" option from the overflow menu.What changes do you think we should make in order to solve the problem?
In
src/libs/actions/IOU/PayMoneyRequest.ts:337:Include
canCancelReimbursement: isPaidViaBankAccount(orpaymentMethodType === CONST.IOU.PAYMENT_TYPE.VBBA) in the optimistic report update:This ensures that immediately upon initiating a business bank account payment, the report state reflects that the reimbursement is pending and can be cancelled before settlement.
What alternative solutions did you explore? (Optional)
isProcessingReport: Rejected becausecanCancelReimbursementis the single source of truth across both optimistic states and backend responses for ACH reimbursement cancellation.Testing
melvin-bot commentedon Oct 21, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
iwiznia commentedon Oct 21, 2026
@mukhrr it depends on the dates the reimbursement was started and tried to cancel, no? Or was this due to the fake reimbursements never being able to be cancelled?
mukhrr commentedon Oct 22, 2026
@iwiznia it's fake reimbursement case. seems the same with this
Abdallah-1551 commentedon Oct 22, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
QA paid an approved expense report from a workspace with a business bank account (
1111) to a member's reimbursable wallet bank account (0000) on staging. Afterward, the report's "More" menu has no "Cancel payment" option. QA expected the option to appear. We need to decide whether this is a real regression, and what, if anything, to change.What is the root cause of that problem?
This is most likely expected behavior, not an App regression.
isCancelPaymentActioninsrc/libs/ReportSecondaryActionUtils.ts(around lines 494-507) returnstrueearly only for "paid elsewhere" payments. For bank payments it ends withreturn !!report.canCancelReimbursement;. Only the server knows whether an in-flight reimbursement can still be cancelled.reimbursementsrow for fake or test bank accounts.canCancelReimbursementis therefore nevertrue, and the option stays hidden. Fast ACH payments also credit the employee immediately and can never be cancelled.report.canCancelReimbursement !== false, would bring back the bug Fix cancel payment showing after the NACHA cutoff has passed #97556 fixed. The option would show for payments Auth cannot cancel, and clicking it would error.canCancelReimbursementoptimistically totruefor all VBBA payments. That has the same flaw. Fast ACH, test accounts and post-cutoff payments are not cancellable, so the option would flash visible and then disappear when the server response arrives, or error on click.What changes do you think we should make in order to solve the problem?
No App code change is needed for the reported scenario. Recommended actions:
PayMoneyRequest.ts(around lines 940-947) does not re-fetch the report after paying. If thePayMoneyRequestresponse lackscanCancelReimbursement, the payer must reopen the report to see the option.canCancelReimbursement.openReportor a report refresh after a successful bank payment.tests/unit/ReportSecondaryActionUtilsTest.ts. It asserts that a bank payment in APPROVED + REIMBURSED state withoutcanCancelReimbursement: truehides the option. Optionally add a test thatcanCancelReimbursement: trueshows it.What alternative solutions did you explore? (Optional)
canCancelReimbursement !== false(opt-out default): rejected. It reintroduces the pre-Fix cancel payment showing after the NACHA cutoff has passed #97556 behavior of offering a cancel action that fails server-side, and ignores that fake and fast-ACH payments are never cancellable.canCancelReimbursement: trueinpayMoneyRequestfor VBBA: rejected. The client lacks the information (NACHA cutoff, fast ACH, test account), so the option would flicker or error.Testing
canCancelReimbursement: true, and that Cancel payment appears in More, immediately or after reopening the report.npm test -- ReportSecondaryActionUtilsTestto confirm the unit tests pass.melvin-bot commentedon Oct 22, 2026
📣 @Abdallah-1551! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Format:
iwiznia commentedon Oct 22, 2026
Ah ok then we can close