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
[Due for payment 2026-08-21] Spends - Pay option isn't shown in offline mode on bulk selection #97753
Version Number: v9.4.49-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:#97581 Email or phone of affected tester (no customers): N/A Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: Windows 11 / Chrome, iPhone 13 / iOS 27 Beta, Samsung Galaxy A52 / Android 14 App Component: Search
Action Performed:
Preconditions:
Prepare 2 accounts named Account A & Account B
Account A create 2 workspaces named Workspace A & Workspace B
Workspace A connect to Bank Account via Workflow -> Payment -> Add bank account
Workspace B invite Account B
Account B create 2 reports and add expense in each report and submit it
Account A approve those expense reports from account B
Account A navigate to Spends -> Reports and filter the workspace to workspace 2
Steps:
8. [Account A] go offline
9. [Account A] select 2 approved report created by account B
10. [Account A] click "N selected" dropdown
Expected Result:
Pay option should be shown after clicking "N selected" dropdown in offline mode, so user can verify the offline modal appears and no payment is attempted
Actual Result:
Pay option isn't shown after clicking "N selected" dropdown in offline mode
changed the title [-]Spends-Pay option isn't shown in offline mode on bulk selection[/-][+]Spends - Pay option isn't shown in offline mode on bulk selection[/+]on Aug 4, 2026
Please re-state the problem that we are trying to solve in this issue.
On Search → Reports, when a user is offline and selects 2+ approved ("Ready to pay") reports, the Pay option is missing from the "N selected" dropdown. It appears normally when online. Expected: Pay should still be shown offline so that clicking it surfaces the offline modal (no payment is attempted).
What is the root cause of that problem?
The bulk-action options array explicitly gates the Pay option behind !isOffline when it is built, so the item is never pushed into the dropdown while offline.
The smoking gun is that the Pay click handler already contains dead code meant to handle the offline case — but it can never be reached because line 2077 removes the option before a user can click it:
This is the intended offline behavior (show the modal), which confirms Pay was meant to render offline. The !isOffline conjunct on line 2077 contradicts it.
Why it's this and not a data-availability issue
!isOffline is the sole cause — the other conjuncts stay truthy offline:
shouldEnableBulkPayOption comes from getPayOption(...) operating on already-selected reports and Onyx-persisted lastPaymentMethods.
bulkPayButtonOptions is built from bankAccountList/fundList, which are Onyx collections that persist offline.
So getBusinessBankAccountOptions returning empty is not the cause; the bank-account data survives offline. This is a deterministic client-side render gate — no logs needed. Note this !isOffline gate is pre-existing, not introduced by #97581 (that PR only added Log.info lines here); QA on #97581 surfaced it because that PR added an offline test expecting Pay to be visible offline.
What changes do you think we should make in order to solve the problem?
Remove the !isOffline conjunct from the shouldShowPayOption condition at src/hooks/useSearchBulkActions.ts:2077, so the Pay option renders while offline. The existing offline guard in onBulkPaySelected (line 1171) then shows the offline modal on click, matching the expected result — no payment is attempted.
Add a unit test asserting the Pay option is present in the bulk-action options when isOffline is true, and that selecting it opens the offline modal rather than calling confirmPayment.
Note on the Hold/Unhold options
Hold/Unhold use the same !isOffline pattern (lines ~2137, ~2170). Those are intentionally offline-hidden (no offline-modal handler), so this change should be scoped to Pay only — do not blanket-remove !isOffline elsewhere.
Related issues
Expensify/App#95832 — "Cannot Pay reports in bulk, only Mark as Paid even though they have VBA connected" (same bulk-pay dropdown surface; different, online cause). Possibly related, not a duplicate.
This is a frontend-only change contained in the App repo.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/97753) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
Implemented the approved proposal: removed the !isOffline gate from shouldShowPayOption in src/hooks/useSearchBulkActions.ts so the Pay option renders in the bulk-actions dropdown while offline. Selecting it now hits the existing offline guard in onBulkPaySelected, which shows the offline modal and attempts no payment — matching the expected result. The change is scoped to Pay only; Approve and Hold/Unhold keep their !isOffline gate since they have no offline-modal handler.
Added a unit test (tests/unit/hooks/useSearchBulkActionsPayTest.ts) asserting Pay is present offline and that selecting it opens the offline modal instead of calling payMoneyRequest. All 70 tests across the useSearchBulkActions suites pass; lint and typecheck are clean.
Please fill out the Tests/QA sections and mark it as "Ready for review" when it is ready.
[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: Not a regression. This is a change request
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.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Activity
applause-bot commentedon Aug 4, 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/b83cd9d3523b30481a4f0ea294c5c2c67eb205d7dde2980e21e9e0b804ea5f6d
[-]Spends-Pay option isn't shown in offline mode on bulk selection[/-][+]Spends - Pay option isn't shown in offline mode on bulk selection[/+]MelvinBot commentedon Aug 4, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On Search → Reports, when a user is offline and selects 2+ approved ("Ready to pay") reports, the Pay option is missing from the "N selected" dropdown. It appears normally when online. Expected: Pay should still be shown offline so that clicking it surfaces the offline modal (no payment is attempted).
What is the root cause of that problem?
The bulk-action options array explicitly gates the Pay option behind
!isOfflinewhen it is built, so the item is never pushed into the dropdown while offline.src/hooks/useSearchBulkActions.ts:2077:The smoking gun is that the Pay click handler already contains dead code meant to handle the offline case — but it can never be reached because line 2077 removes the option before a user can click it:
src/hooks/useSearchBulkActions.ts:1171-1174:This is the intended offline behavior (show the modal), which confirms Pay was meant to render offline. The
!isOfflineconjunct on line 2077 contradicts it.Why it's this and not a data-availability issue
!isOfflineis the sole cause — the other conjuncts stay truthy offline:shouldEnableBulkPayOptioncomes fromgetPayOption(...)operating on already-selected reports and Onyx-persistedlastPaymentMethods.bulkPayButtonOptionsis built frombankAccountList/fundList, which are Onyx collections that persist offline.So
getBusinessBankAccountOptionsreturning empty is not the cause; the bank-account data survives offline. This is a deterministic client-side render gate — no logs needed. Note this!isOfflinegate is pre-existing, not introduced by #97581 (that PR only addedLog.infolines here); QA on #97581 surfaced it because that PR added an offline test expecting Pay to be visible offline.What changes do you think we should make in order to solve the problem?
Remove the
!isOfflineconjunct from theshouldShowPayOptioncondition atsrc/hooks/useSearchBulkActions.ts:2077, so the Pay option renders while offline. The existing offline guard inonBulkPaySelected(line 1171) then shows the offline modal on click, matching the expected result — no payment is attempted.Add a unit test asserting the Pay option is present in the bulk-action options when
isOfflineis true, and that selecting it opens the offline modal rather than callingconfirmPayment.Note on the Hold/Unhold options
Hold/Unhold use the same
!isOfflinepattern (lines ~2137, ~2170). Those are intentionally offline-hidden (no offline-modal handler), so this change should be scoped to Pay only — do not blanket-remove!isOfflineelsewhere.Related issues
Expensify/App#95832— "Cannot Pay reports in bulk, only Mark as Paid even though they have VBA connected" (same bulk-pay dropdown surface; different, online cause). Possibly related, not a duplicate.This is a frontend-only change contained in the App repo.
Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/97753)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
j3ffffff commentedon Aug 4, 2026
melvin-bot commentedon Aug 4, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @DylanDylann (
External)melvin-bot commentedon Aug 4, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022084493037679961752
DylanDylann commentedon Aug 6, 2026
@MelvinBot Implement this
MelvinBot commentedon Aug 6, 2026
🤖 Draft PR created: #97942
Implemented the approved proposal: removed the
!isOfflinegate fromshouldShowPayOptioninsrc/hooks/useSearchBulkActions.tsso the Pay option renders in the bulk-actions dropdown while offline. Selecting it now hits the existing offline guard inonBulkPaySelected, which shows the offline modal and attempts no payment — matching the expected result. The change is scoped to Pay only; Approve and Hold/Unhold keep their!isOfflinegate since they have no offline-modal handler.Added a unit test (
tests/unit/hooks/useSearchBulkActionsPayTest.ts) asserting Pay is present offline and that selecting it opens the offline modal instead of callingpayMoneyRequest. All 70 tests across theuseSearchBulkActionssuites pass; lint and typecheck are clean.Please fill out the
Tests/QAsections and mark it as "Ready for review" when it is ready.7 remaining items
melvin-bot commentedon Aug 17, 2026
@DylanDylann Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
DylanDylann commentedon Aug 18, 2026
BugZero 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: Not a regression. This is a change request
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.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue: https://github.com/Expensify/Expensify/issues/674197
Regression Test Proposal
Test:
Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-c38f-a363-5882-a454f7d91d14melvin-bot commentedon Aug 20, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Aug 20, 2026
Payment Summary
Resolving PRs:
Show Pay option in bulk actions dropdown while offline #97942
Reviewer: @DylanDylann owed $250 via NewDot
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon Aug 21, 2026
Payment Summary
Contributor+: @DylanDylann due $250 via NewDot
quinthar commentedon Sep 26, 2026
Approved $250 to @DylanDylann