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
"Pay" appears offline for bulk selected expenses in report #87671
Version Number: 9.3.58-1 Reproducible in staging?: Yes Reproducible in production?: N/A - new feature, doesn't exist in prod If this was caught during regression testing, add the test name, ID and link from BrowserStack:#85796 Test 9, step 5 Email or phone of affected tester (no customers): N/A Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: MacBook Air 15.7.4 Chrome, iPhone 15 iOS 26.3.1 App Component: Money Requests
Action Performed:
Sign in to ND
Create a workspace, create a report with 2-3 expenses
Go offline
Open an expense report, long-press to enter selection mode, select all expenses
Click Submit, select all the expenses again and click Approve
Select all the expenses and verify Pay does not appear
Expected Result:
"Pay" does not appear for bulk selected expenses in offline mode
Actual Result:
"Pay" appears for bulk selected expenses in offline mode
👋 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:
Identify the pull request that introduced this issue and revert it.
Investigation Summary - Classification: Frontend bug. Causing PR: #85796 by @Krishna2323 (High confidence). Title: Add selection mode Submit/Approve/Pay actions for mobile layout. Recommendation: REVERT. PR 85796 introduced selection mode Submit/Approve/Pay actions for mobile layout and contains a logic error causing Pay to appear while offline. Reverting will immediately fix the issue since this is a new feature not yet in production. Assigned: @Krishna2323 (PR author), @situchan (approving reviewer), @puneetlath (approving reviewer). Labels: DeployBlockerCash is correctly applied - no label changes needed. Root cause: The bug is in src/hooks/useSelectionModeReportActions.ts at line 509. The offline guard is: hasPayAction AND NOT (isOffline AND NOT canAllowSettlement). This only hides Pay when BOTH isOffline is true AND canAllowSettlement is false. Since canAllowSettlement is computed from hasUpdatedTotal(report, policy) and can return true even while offline (it checks if the report total is up to date, not network connectivity), Pay renders in offline mode whenever the report has a valid total. The expected behavior per QA step 9 of the PR itself is that Pay should not appear when offline. The fix should use a direct isOffline check to unconditionally hide Pay when offline.
The selection mode bulk action menus use the condition hasPayAction && !(isOffline && !canAllowSettlement) to decide whether to show "Pay" (useSelectionModeReportActions.ts:509, MoneyReportHeader.tsx:1222). This simplifies to "show Pay when online, OR when offline if canAllowSettlement is true." Since canAllowSettlement (hasUpdatedTotal) returns true for most reports (it only returns false for edge cases like pending cross-currency transactions), Pay appears in the selection mode dropdown even when offline — particularly after optimistic Submit → Approve transitions, where the report state appears "approved" locally despite the server never having confirmed it.
What changes do you think we should make in order to solve the problem?
What alternative solutions did you explore? (Optional)
An alternative would be to check whether the report has pending optimistic actions (e.g., a pendingAction on the report from submit/approve) and only hide Pay in that case. However, the simpler approach of hiding Pay entirely when offline in selection mode matches the expected behavior described in the issue and is consistent with how the search bulk actions handle this (useSearchBulkActions.ts:1173 already uses !isOffline as a hard gate for Pay).
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.
Activity
melvin-bot commentedon Apr 10, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #85796
melvin-bot commentedon Apr 10, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Apr 10, 2026
👋 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:
roryabraham commentedon Apr 10, 2026
Where do the expected steps come from? Is there some reason bulk-paying expense reports is not expected to be supported offline?
OSBotify commentedon Apr 10, 2026
Investigation Summary - Classification: Frontend bug. Causing PR: #85796 by @Krishna2323 (High confidence). Title: Add selection mode Submit/Approve/Pay actions for mobile layout. Recommendation: REVERT. PR 85796 introduced selection mode Submit/Approve/Pay actions for mobile layout and contains a logic error causing Pay to appear while offline. Reverting will immediately fix the issue since this is a new feature not yet in production. Assigned: @Krishna2323 (PR author), @situchan (approving reviewer), @puneetlath (approving reviewer). Labels: DeployBlockerCash is correctly applied - no label changes needed. Root cause: The bug is in src/hooks/useSelectionModeReportActions.ts at line 509. The offline guard is: hasPayAction AND NOT (isOffline AND NOT canAllowSettlement). This only hides Pay when BOTH isOffline is true AND canAllowSettlement is false. Since canAllowSettlement is computed from hasUpdatedTotal(report, policy) and can return true even while offline (it checks if the report total is up to date, not network connectivity), Pay renders in offline mode whenever the report has a valid total. The expected behavior per QA step 9 of the PR itself is that Pay should not appear when offline. The fix should use a direct isOffline check to unconditionally hide Pay when offline.
MelvinBot commentedon Apr 10, 2026
Proposal
What is the root cause of that problem?
The selection mode bulk action menus use the condition
hasPayAction && !(isOffline && !canAllowSettlement)to decide whether to show "Pay" (useSelectionModeReportActions.ts:509,MoneyReportHeader.tsx:1222). This simplifies to "show Pay when online, OR when offline ifcanAllowSettlementis true." SincecanAllowSettlement(hasUpdatedTotal) returnstruefor most reports (it only returnsfalsefor edge cases like pending cross-currency transactions), Pay appears in the selection mode dropdown even when offline — particularly after optimistic Submit → Approve transitions, where the report state appears "approved" locally despite the server never having confirmed it.What changes do you think we should make in order to solve the problem?
Change the condition in both locations from:
hasPayAction && !(isOffline && !canAllowSettlement)→hasPayAction && !isOfflineThis hides the Pay action entirely when offline in selection mode. The two locations are:
src/hooks/useSelectionModeReportActions.ts:509(mobile/narrow layout)src/components/MoneyReportHeader.tsx:1222(wide/desktop layout)What alternative solutions did you explore? (Optional)
An alternative would be to check whether the report has pending optimistic actions (e.g., a
pendingActionon the report from submit/approve) and only hide Pay in that case. However, the simpler approach of hiding Pay entirely when offline in selection mode matches the expected behavior described in the issue and is consistent with how the search bulk actions handle this (useSearchBulkActions.ts:1173already uses!isOfflineas a hard gate for Pay).Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.roryabraham commentedon Apr 10, 2026
looks like the expected steps come from the QA steps in the PR: #85796
roryabraham commentedon Apr 10, 2026
Coming from https://expensify.slack.com/archives/C01GTK53T8Q/p1775849232466899, this is expected behavior. closing as not planned