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-07-13] [$250] iOS-Expense- App freezes when pay transactions with locked account #95026
Version Number: 9.4.25-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:#92518 Email or phone of affected tester (no customers):applausetester+dk12@applause.expensifail.com Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: iPhone 11/iOS 26.5 App Component: Money Requests
Action Performed:
Preconditions:
Account has a payable report: from 2 expenses
Lock the account
Open Hybrid app
Open the payable report
Select all transactions
Tap on 'X selected' button
Select Pay > Mark as paid
Expected Result:
Test 9: the locked account modal appears immediately
Root cause (high confidence): This is a regression from #92518 (merged 2026-06-29), which added bulk Pay/Approve/Submit to report selection mode. In the new bulk-pay path the locked-account modal is opened synchronously while the payment popover is still dismissing, so two native modals transition at the same instant — a classic React Native iOS deadlock that freezes the app. The single-report Pay button never freezes because it runs the same check after the popover has fully hidden.
Proposal
What is the root cause of that problem?
Tapping a payment sub-item goes through PopoverMenu.selectItem. Because bulk items are marked shouldCallAfterModalHide, this branch runs:
PopoverMenu/index.tsx:414-421 — onItemSelected?.(...) fires synchronously (line 415), then close(...) (line 416) starts dismissing the popover <Modal>.
onItemSelected → onSubItemSelected → onSelectionModePaymentSelect, which calls shouldBlockAction() synchronously. For a locked account that immediately mounts the global locked-account ConfirmModal:
useSelectionModeReportActions.ts:218-227 — the comment even states shouldBlockAction is "checked synchronously for immediate modal feedback." Only basePaymentSelect is wrapped in InteractionManager; the block-check (and thus showLockedAccountModal) is not deferred.
So the locked-account modal presents at the same moment the popover modal begins its dismiss animation → overlapping native modal transitions → freeze.
Why the single-report Pay button doesn't freeze:SettlementButton puts the identical check inside each option's own onSelected (SettlementButton/index.tsx:200-203 via checkForNecessaryAction, wired at :333). PopoverMenu runs onSelected inside the close(() => selectedItem.onSelected?.()) callback — i.e. after the popover is gone — so there is no modal overlap.
What changes do you think we should make in order to solve the problem?
Make the bulk path run the locked/blocked-action check after the popover hides, matching SettlementButton. Minimal fix: in useSelectionModeReportActions.tsonSelectionModePaymentSelect, move the shouldBlockAction() call inside the existing InteractionManager.runAfterInteractions(...) callback (rather than running it synchronously before it), so showLockedAccountModal() fires only after the popover <Modal> has dismissed. This preserves "modal appears immediately" from the user's perspective while removing the overlap. The same structural issue exists on the search/desktop bulk path via MoneyReportHeaderSelectionDropdown.tsx → MoneyReportHeaderKYCDropdown and should be fixed the same way.
Alternatively (more consistent with SettlementButton), give the non-invoice payment sub-items in usePaymentOptions.ts their own onSelected that performs the block-check, and drop the synchronous onSubItemSelected payment branch.
What alternative solutions did you explore? (Optional)
Considered the delegate-no-access modal (Test 8) as an alternative trigger, but that path is the same synchronous shouldBlockAction code — the locked-account case (Test 9) is what's reported and matches the freeze mechanism. The invoice pay sub-items already set their own onSelected, so they run after modal hide and are not expected to freeze.
Investigation details & confidence
Confidence: High — the freeze is fully traced through code: synchronous onItemSelected (PopoverMenu:415) mounting a global ConfirmModal while close() (PopoverMenu:416) dismisses the popover modal, versus the safe onSelected-via-close() timing in SettlementButton.
Reported repro is a non-invoice payable expense report, whose payment sub-items have no onSelected and therefore route through the synchronous onSubItemSelected/onItemSelected path.
No production logs needed — this is a deterministic UI/timing bug. An iOS device repro would only confirm the overlapping-modal freeze visually.
Since the root cause is entirely within the App repo, no cross-repo escalation is required.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/95026) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
Please re-state the problem that we are trying to solve in this issue.
On iOS, selecting Pay > Mark as paid for multiple transactions while the account is locked freezes the app instead of displaying the locked-account modal.
What is the root cause of that problem?
In src/components/Search/SearchBulkActionsButton.tsx, the dropdown selection calls handleBulkPayItemSelected(). Its locked-account branch in src/libs/actions/Search.ts immediately calls showLockedAccountModal() while ButtonWithDropdownMenu is still dismissing its popover. Presenting the locked-account modal during that iOS modal transition causes the UI to freeze.
What changes do you think we should make in order to solve the problem?
In SearchBulkActionsButton, defer the locked-account modal until the bulk-action menu has fully closed. Pass handleBulkPayItemSelected() a wrapper that records a pending locked-account modal request, then use ButtonWithDropdownMenu’s onOptionsMenuHide callback to clear that pending state and call showLockedAccountModal(). Apply this to both narrow and wide layout dropdowns.
This preserves the existing validation order in handleBulkPayItemSelected() while preventing overlapping modal transitions on iOS.
What alternative solutions did you explore? (Optional)
Adding an arbitrary timeout before showLockedAccountModal() would also avoid overlapping presentations, but tying it to onOptionsMenuHide is deterministic and does not depend on animation timing.
When all transactions of a payable report are selected and the user taps X selected → Pay → Mark as paid, the tapped payment sub-item is handled by MoneyReportHeaderKYCDropdown, whose ButtonWithDropdownMenu runs onSubItemSelectedsynchronously first and only closes the popover afterwards:
onSubItemSelected calls onPaymentSelect, which is the selection-mode wrapper onSelectionModePaymentSelect. That wrapper calls shouldBlockAction(iouPaymentType)synchronously, before its InteractionManager.runAfterInteractions block:
So the locked-account modal is presented while the payment popover (itself a native Modal) is still open — showLockedAccountModal() fires on the same synchronous tick, then setIsMenuVisible(false) runs to start closing the popover. On iOS, presenting a JS Modal while another Modal is still on screen deadlocks the native modal presentation → the app freezes. On web/Android there is no native modal-on-modal deadlock, so it does not reproduce (matches the iOS-only report).
Note this shouldBlockAction guard is a redundant one — the deferred basePaymentSelect already checks it again at its first line, and the file even documents it as redundant (added in PR #92518, commit "Add clarifying comment for redundant shouldBlockAction guard in mobile payment select"):
So: locked account → payment sub-item tap → shouldBlockAction shows the locked modal synchronously before the popover closes → two stacked native modals on iOS → freeze.
For comparison, the flows that correctly show this modal from inside a popover close the popover first and only then show the locked modal in the after-close callback, e.g. WalletPage: closeModal(() => showLockedAccountModal()):
What changes do you think we should make in order to solve the problem?
Remove the redundant synchronousshouldBlockAction guard from the wrapper and let the check happen inside the already-existing InteractionManager.runAfterInteractions callback (via basePaymentSelect, which checks shouldBlockAction at its first line). By then the popover has finished hiding, so showLockedAccountModal() is presented on a clean stack — no modal-on-modal freeze:
- // Wrap payment select with InteractionManager for mobile performance- // Note: shouldBlockAction is checked synchronously for immediate modal feedback,- // and also inside basePaymentSelect (for the desktop path that uses it directly).
const onSelectionModePaymentSelect = (event: KYCFlowEvent, iouPaymentType: PaymentMethodType, triggerKYCFlow: TriggerKYCFlow) => {
- if (shouldBlockAction(iouPaymentType)) {- return;- }
InteractionManager.runAfterInteractions(() => {
basePaymentSelect(event, iouPaymentType, triggerKYCFlow);
});
};
This is the smallest possible change (deletes the redundant guard already documented as redundant), keeps the existing locked/delegate/verify blocking intact (all three are re-checked inside basePaymentSelect), and applies to all platforms uniformly. InteractionManager.runAfterInteractions fires after the popover close animation completes, which is exactly the "close popover then show modal" ordering the working flows use.
Minor changes/improvements can be discussed in the PR phase.
What alternative solutions did you explore? (Optional)
Keep the synchronous guard but wrap the modal call in the popover's after-hide callback, i.e. route showLockedAccountModal() through the dropdown's onOptionsMenuHide/closeModal(() => showLockedAccountModal()) like WalletPage does. This works too, but it adds new wiring for a check that already runs (deferred) inside basePaymentSelect, so simply dropping the redundant early guard is fewer lines and lower regression risk while fixing the same root cause.
The same synchronous-guard-before-popover-close pattern also exists for the "Pay with workspace" path (onWorkspacePolicySelect → handleWorkspaceSelected's shouldBlockAction()); if desired it can be given the same deferral, but it is outside the reported repro (Mark as paid) and can be handled in the PR phase.
🚨 Edited by proposal-police: This proposal was edited at 2026-07-01 06:30:04 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
On iOS, selecting all transactions on a payable report and choosing Pay > Mark as paid while the account is locked freezes the whole app, instead of showing the "locked account" modal.
What is the root cause of that problem?
The locked-account modal is presented on top of the still-open selection popover, and iOS cannot stack a second native Modal over one that is dismissing → the JS/UI thread deadlocks (freeze). This only happens when a second modal is triggered, i.e. exactly the locked-account case.
Chain:
In selection mode the "Pay" menu is a ButtonWithDropdownMenu. When you tap Mark as paid, PopoverMenu.selectItem runs the shouldCallAfterModalHide branch and calls the onItemSelected prop before it calls close() —
So the ConfirmModal opens while the popover Modal is still mounted. On iOS that is the freeze; on Android/web modals stack fine — which is why only iOS: App is checked.
Structural cause:shouldCallAfterModalHide is supposed to defer the action until after the popover hides, but it only defers the item's own onSelected callback — the onItemSelectedprop (used by these bulk flows) still fires beforeclose(). The working single-report path proves it: SettlementButton runs the identical isAccountLocked → showLockedAccountModal guard inside each option's onSelected (
(same freeze when bulk-paying from Search on iOS).
What changes do you think we should make in order to solve the problem?
Make shouldCallAfterModalHide honor its contract: defer the onItemSelected prop until after the popover hides, exactly like onSelected already is. In PopoverMenu.selectItem, move the onItemSelected call into the close() callback:
The locked-account modal then opens only after the popover is gone — no stacked iOS modals. This is the single convergence point, so it fixes both the report toolbar and the Search bulk path in one change.
Regression safety: only items already flagged shouldCallAfterModalHide change, and they already defer onSelected to after-hide — so any consumer reading state in onItemSelected already expects post-selection timing; items without the flag (the common case) are untouched.
Why the one-line fix fails: "just call showLockedAccountModal" is already there (line 128) — the guard does fire; the freeze is the timing, the modal is shown over the open popover. And relying on the existing shouldCallAfterModalHide does nothing here, because it only defers item.onSelected, while the bulk flows deliver the guard through the onItemSelectedprop, which fires beforeclose().
What alternative solutions did you explore? (Optional)
Localized (scoped) alternative: leave PopoverMenu untouched and instead defer the guard inside the two bulk consumers — move the isAccountLocked/showLockedAccountModal check out of onSubItemSelected and into the payment item's deferred onSelected, mirroring SettlementButton. Correct, but must be duplicated at each call site (MoneyReportHeaderKYCDropdown + both SearchBulkActionsButton sites) and misses any future onSubItemSelected consumer.
Spot-fix — wrap showLockedAccountModal in InteractionManager.runAfterInteractions. Rejected: it papers over the timing without fixing the structural "onItemSelected fires before close," and runAfterInteractions is not a reliable "after this modal hid" signal, so it can still race on slow devices.
This is an iOS native "modal presented on top of a dismissing modal" deadlock.
In the report view, the selection toolbar routes payment selection through useSelectionModeReportActions. When you tap Pay > Mark as paid in the popover submenu, the popover (a native Modal on iOS) starts dismissing and onSelectionModePaymentSelect fires. That wrapper checks shouldBlockActionsynchronously, on purpose:
So the locked-account confirm modal tries to present while the payment popover modal is still animating out. On iOS you cannot present a new modal over a view controller that is mid-dismiss — the presentation never completes and the JS/UI thread hangs, which is the "freeze."
The whole reason the actual payment call basePaymentSelect is already wrapped in InteractionManager.runAfterInteractions (line 224) is to wait for that popover dismissal before doing navigation/modal work. The block check was deliberately pulled out of that deferral "for immediate modal feedback," and that's exactly what reintroduces the freeze for the locked (and delegate/verify) cases. It's iOS-only because Android/web can stack these modals.
What changes do you think we should make in order to solve the problem?
Defer the block check so the locked-account modal is only presented after the popover has finished dismissing. In useSelectionModeReportActions.onSelectionModePaymentSelect (lines 220-227), move the shouldBlockAction(iouPaymentType) early-return inside the InteractionManager.runAfterInteractions callback instead of running it synchronously.
basePaymentSelect (the base onSelectionModePaymentSelect from useSelectionModePayment) already calls shouldBlockAction itself at
, so the simplest correct fix is to drop the redundant synchronous check in the wrapper and let the deferred inner check present the modal. Net effect: payment is still blocked when the account is locked, and the locked modal now appears cleanly once the popover is gone (matching the expected "modal appears immediately" behavior, minus the freeze).
This is a timing/hook-layer fix, not a data or render fix — the state (isAccountLocked) is already correct; only the moment of modal presentation is wrong.
One thing to double-check while implementing: the header variant MoneyReportHeaderSelectionDropdown passes useSelectionModePayment's base onSelectionModePaymentSelect directly (
), which also calls shouldBlockAction synchronously and can hit the same freeze on iOS. Deferring the modal presentation at the shouldBlockAction/showLockedAccountModal boundary would cover both entry points.
What alternative solutions did you explore? (Optional)
Defer the presentation inside showLockedAccountModal/useConfirmModal itself (wrap showConfirmModal in InteractionManager.runAfterInteractions). Rejected: that hook is shared by many unrelated confirm modals that aren't opened from a dismissing popover, so it would add latency everywhere and mask the real cause instead of fixing the specific popover→modal handoff.
Gate the deferral behind getPlatform() === CONST.PLATFORM.IOS (mirroring the existing platform-specific branch in onHoldMenuOpen, lines 200-209). Rejected as unnecessary — InteractionManager.runAfterInteractions resolves promptly on Android/web, so a single cross-platform deferral keeps the code simpler without a behavioral downside.
Please re-state the problem that we are trying to solve in this issue.
On iOS, selecting all transactions in a payable report → X selected → Pay → Mark as paid on a locked account freezes the entire app instead of showing the locked-account modal.
What is the root cause of that problem?
In the report selection mode, the payment sub-items are rendered by MoneyReportHeaderKYCDropdown, whose onSubItemSelected is wired straight into PopoverMenu's onItemSelected:
For a leaf sub-item flagged shouldCallAfterModalHide, PopoverMenu.selectItem calls onItemSelectedsynchronously, before the popover is closed — only the item's own onSelected is deferred to after the modal hides:
So onSubItemSelected → onPaymentSelect → onSelectionModePaymentSelect → shouldBlockAction runs while the payment popover is still mounted, and it shows the locked-account ConfirmModal immediately:
On iOS this mounts a second native modal on top of the still-open popover modal. Two overlapping RN modals deadlock the presentation and the app freezes.
For comparison, SettlementButton runs the exact same guard from each payment option's deferred onSelected (which fires only after the popover has hidden), so it never overlaps modals and works fine:
What changes do you think we should make in order to solve the problem?
Defer the guard modals in shouldBlockAction so they mount only after the payment popover finishes dismissing, while still blocking the payment synchronously. In src/hooks/useSelectionModePayment.ts:
shouldBlockAction still returns true immediately so the payment is stopped, but the ConfirmModal is presented after the popover's dismiss interaction completes — only one native modal is ever on screen at a time. The VERIFY_ACCOUNT branch is a navigation, not a modal, so it doesn't need deferring.
What specific scenarios should we cover in automated tests to prevent reintroducing this in the future?
With a locked account, invoking shouldBlockAction from the selection-mode pay flow returns true and schedules showLockedAccountModal via InteractionManager.runAfterInteractions (assert the modal is shown after interactions flush, not synchronously).
Same assertion for the delegate-restricted branch (showDelegateNoAccessModal).
Non-blocking case (unlocked, validated) returns false and shows no modal.
What alternative solutions did you explore? (Optional)
Restructure MoneyReportHeaderKYCDropdown so each payment sub-item carries its guard in the deferred onSelected callback (the pattern SettlementButton already uses) instead of the synchronous onSubItemSelected. This is the more structural fix but larger, since the sub-items need triggerKYCFlow/event threaded from the KYCWall render prop into each item. Another option is to flush a pending guard action from the popover's onOptionsMenuHide, but that adds ref-plumbing for the same effect the deferred call achieves directly.
🚨 Edited by proposal-police: This proposal was edited at 2026-07-01 06:42:56 UTC.
Proposal
What is the root cause of that problem?
The selected-expense pay menu is trying to show the locked-account modal from inside the dropdown item-selection callback, before the dropdown/submenu has actually finished closing.
ButtonWithDropdownMenu marks dropdown items and subitems with shouldCallAfterModalHide, but its PopoverMenu.onItemSelected handler still invokes the consumer callback (onSubItemSelected) before it hides the menu. PopoverMenu also calls onItemSelected before the delayed close() callback runs for shouldCallAfterModalHide items, so subitem consumers can run too early.
In this selected-expense payment flow, that early subitem callback calls onSelectionModePaymentSelect. On mobile it immediately runs shouldBlockAction(), and locked accounts make that guard call showLockedAccountModal(). That opens a second modal while the pay dropdown is still closing, which matches the iOS freeze/splash behavior instead of the locked-account modal appearing cleanly.
What changes do you think we should make in order to solve the problem?
Make ButtonWithDropdownMenu honor shouldCallAfterModalHide for the callbacks it owns. When mapping root items and submenu items for PopoverMenu, attach delayed onSelected handlers that invoke onOptionSelected/onSubItemSelected after PopoverMenu.close() completes, and let onItemSelected only update local dropdown state such as the selected index and visible flag.
For submenu items, preserve any existing subItem.onSelected behavior, but run it from the same delayed wrapper as onSubItemSelected so payment subitems do not execute once before close and again after close. This keeps the locked-account guard in the shared payment hook, but ensures showLockedAccountModal() runs only after the payment dropdown has been dismissed.
Add or update a ButtonWithDropdownMenu/PopoverMenu unit test proving a submenu item's consumer callback is not called until after the close callback when shouldCallAfterModalHide is true.
Manually verify on iOS native/hybrid that selecting all payable expenses and choosing Pay > Mark as paid on a locked account closes the dropdown and then shows the locked-account modal without freezing.
Regression-check that an unlocked account can still use Pay > Mark as paid from the same selected-expense dropdown.
What alternative solutions did you explore? (Optional)
We could special-case locked accounts in useSelectionModeReportActions or useSelectionModePayment with another InteractionManager.runAfterInteractions() deferral, but that only patches this payment path and leaves ButtonWithDropdownMenu continuing to advertise delayed execution while onSubItemSelected bypasses it.
Contributor: @Krishna2323 due $250 via NewDot
Contributor+: @situchan due $250 via NewDot
^ Test case created. Thx
NO idea how this got missed for over a month. I check [Due for payment many days a week via emails from GH. Apologies (at least it's the only one I've missed that is this old, that I can remember)
Activity
applause-bot commentedon Jul 1, 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/cf4e794fed9397edf763971d961c9d063658b78040f340650dee3672b1b11e74
MelvinBot commentedon Jul 1, 2026
Issue Analysis
Root cause (high confidence): This is a regression from #92518 (merged 2026-06-29), which added bulk Pay/Approve/Submit to report selection mode. In the new bulk-pay path the locked-account modal is opened synchronously while the payment popover is still dismissing, so two native modals transition at the same instant — a classic React Native iOS deadlock that freezes the app. The single-report Pay button never freezes because it runs the same check after the popover has fully hidden.
Proposal
What is the root cause of that problem?
Tapping a payment sub-item goes through
PopoverMenu.selectItem. Because bulk items are markedshouldCallAfterModalHide, this branch runs:PopoverMenu/index.tsx:414-421—onItemSelected?.(...)fires synchronously (line 415), thenclose(...)(line 416) starts dismissing the popover<Modal>.onItemSelected→onSubItemSelected→onSelectionModePaymentSelect, which callsshouldBlockAction()synchronously. For a locked account that immediately mounts the global locked-accountConfirmModal:useSelectionModePayment.ts:122-130—if (isAccountLocked) { showLockedAccountModal(); return true; }useSelectionModeReportActions.ts:218-227— the comment even statesshouldBlockActionis "checked synchronously for immediate modal feedback." OnlybasePaymentSelectis wrapped inInteractionManager; the block-check (and thusshowLockedAccountModal) is not deferred.MoneyReportHeaderKYCDropdown.tsx:85-97—onSubItemSelectedcallsonPaymentSelect(...)directly in the synchronous path.So the locked-account modal presents at the same moment the popover modal begins its dismiss animation → overlapping native modal transitions → freeze.
Why the single-report Pay button doesn't freeze:
SettlementButtonputs the identical check inside each option's ownonSelected(SettlementButton/index.tsx:200-203viacheckForNecessaryAction, wired at:333).PopoverMenurunsonSelectedinside theclose(() => selectedItem.onSelected?.())callback — i.e. after the popover is gone — so there is no modal overlap.What changes do you think we should make in order to solve the problem?
Make the bulk path run the locked/blocked-action check after the popover hides, matching
SettlementButton. Minimal fix: inuseSelectionModeReportActions.tsonSelectionModePaymentSelect, move theshouldBlockAction()call inside the existingInteractionManager.runAfterInteractions(...)callback (rather than running it synchronously before it), soshowLockedAccountModal()fires only after the popover<Modal>has dismissed. This preserves "modal appears immediately" from the user's perspective while removing the overlap. The same structural issue exists on the search/desktop bulk path viaMoneyReportHeaderSelectionDropdown.tsx→MoneyReportHeaderKYCDropdownand should be fixed the same way.Alternatively (more consistent with
SettlementButton), give the non-invoice payment sub-items inusePaymentOptions.tstheir ownonSelectedthat performs the block-check, and drop the synchronousonSubItemSelectedpayment branch.What alternative solutions did you explore? (Optional)
Considered the delegate-no-access modal (Test 8) as an alternative trigger, but that path is the same synchronous
shouldBlockActioncode — the locked-account case (Test 9) is what's reported and matches the freeze mechanism. The invoice pay sub-items already set their ownonSelected, so they run after modal hide and are not expected to freeze.Investigation details & confidence
onItemSelected(PopoverMenu:415) mounting a globalConfirmModalwhileclose()(PopoverMenu:416) dismisses the popover modal, versus the safeonSelected-via-close()timing inSettlementButton.onSelectedand therefore route through the synchronousonSubItemSelected/onItemSelectedpath.Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/95026)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
kitvasyl commentedon Jul 1, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On iOS, selecting Pay > Mark as paid for multiple transactions while the account is locked freezes the app instead of displaying the locked-account modal.
What is the root cause of that problem?
In
src/components/Search/SearchBulkActionsButton.tsx, the dropdown selection callshandleBulkPayItemSelected(). Its locked-account branch insrc/libs/actions/Search.tsimmediately callsshowLockedAccountModal()whileButtonWithDropdownMenuis still dismissing its popover. Presenting the locked-account modal during that iOS modal transition causes the UI to freeze.What changes do you think we should make in order to solve the problem?
In
SearchBulkActionsButton, defer the locked-account modal until the bulk-action menu has fully closed. PasshandleBulkPayItemSelected()a wrapper that records a pending locked-account modal request, then useButtonWithDropdownMenu’sonOptionsMenuHidecallback to clear that pending state and callshowLockedAccountModal(). Apply this to both narrow and wide layout dropdowns.This preserves the existing validation order in
handleBulkPayItemSelected()while preventing overlapping modal transitions on iOS.What alternative solutions did you explore? (Optional)
Adding an arbitrary timeout before
showLockedAccountModal()would also avoid overlapping presentations, but tying it toonOptionsMenuHideis deterministic and does not depend on animation timing.yusufdeveloper2903 commentedon Jul 1, 2026
Proposal
What is the root cause of that problem?
When all transactions of a payable report are selected and the user taps
X selected→Pay→Mark as paid, the tapped payment sub-item is handled byMoneyReportHeaderKYCDropdown, whoseButtonWithDropdownMenurunsonSubItemSelectedsynchronously first and only closes the popover afterwards:App/src/components/ButtonWithDropdownMenu/index.tsx
Lines 285 to 289 in 0d736c7
onSubItemSelectedcallsonPaymentSelect, which is the selection-mode wrapperonSelectionModePaymentSelect. That wrapper callsshouldBlockAction(iouPaymentType)synchronously, before itsInteractionManager.runAfterInteractionsblock:App/src/hooks/useSelectionModeReportActions.ts
Lines 211 to 221 in 0d736c7
For a locked account
shouldBlockActionimmediately callsshowLockedAccountModal():App/src/hooks/useSelectionModePayment.ts
Lines 122 to 136 in 0d736c7
showLockedAccountModal()mounts a globalConfirmModal:App/src/components/LockedAccountModalProvider/index.tsx
Lines 22 to 29 in 0d736c7
So the locked-account modal is presented while the payment popover (itself a native
Modal) is still open —showLockedAccountModal()fires on the same synchronous tick, thensetIsMenuVisible(false)runs to start closing the popover. On iOS, presenting a JSModalwhile anotherModalis still on screen deadlocks the native modal presentation → the app freezes. On web/Android there is no native modal-on-modal deadlock, so it does not reproduce (matches the iOS-only report).Note this
shouldBlockActionguard is a redundant one — the deferredbasePaymentSelectalready checks it again at its first line, and the file even documents it as redundant (added in PR #92518, commit "Add clarifying comment for redundant shouldBlockAction guard in mobile payment select"):App/src/hooks/useSelectionModePayment.ts
Lines 272 to 275 in 0d736c7
So: locked account → payment sub-item tap →
shouldBlockActionshows the locked modal synchronously before the popover closes → two stacked native modals on iOS → freeze.For comparison, the flows that correctly show this modal from inside a popover close the popover first and only then show the locked modal in the after-close callback, e.g.
WalletPage:closeModal(() => showLockedAccountModal()):App/src/pages/settings/Wallet/WalletPage/index.tsx
Lines 478 to 482 in 0d736c7
What changes do you think we should make in order to solve the problem?
Remove the redundant synchronous
shouldBlockActionguard from the wrapper and let the check happen inside the already-existingInteractionManager.runAfterInteractionscallback (viabasePaymentSelect, which checksshouldBlockActionat its first line). By then the popover has finished hiding, soshowLockedAccountModal()is presented on a clean stack — no modal-on-modal freeze:This is the smallest possible change (deletes the redundant guard already documented as redundant), keeps the existing locked/delegate/verify blocking intact (all three are re-checked inside
basePaymentSelect), and applies to all platforms uniformly.InteractionManager.runAfterInteractionsfires after the popover close animation completes, which is exactly the "close popover then show modal" ordering the working flows use.Minor changes/improvements can be discussed in the PR phase.
What alternative solutions did you explore? (Optional)
Keep the synchronous guard but wrap the modal call in the popover's after-hide callback, i.e. route
showLockedAccountModal()through the dropdown'sonOptionsMenuHide/closeModal(() => showLockedAccountModal())likeWalletPagedoes. This works too, but it adds new wiring for a check that already runs (deferred) insidebasePaymentSelect, so simply dropping the redundant early guard is fewer lines and lower regression risk while fixing the same root cause.The same synchronous-guard-before-popover-close pattern also exists for the "Pay with workspace" path (
onWorkspacePolicySelect→handleWorkspaceSelected'sshouldBlockAction()); if desired it can be given the same deferral, but it is outside the reported repro (Mark as paid) and can be handled in the PR phase.ahmdshrif commentedon Jul 1, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-07-01 06:30:04 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
On iOS, selecting all transactions on a payable report and choosing Pay > Mark as paid while the account is locked freezes the whole app, instead of showing the "locked account" modal.
What is the root cause of that problem?
The locked-account modal is presented on top of the still-open selection popover, and iOS cannot stack a second native
Modalover one that is dismissing → the JS/UI thread deadlocks (freeze). This only happens when a second modal is triggered, i.e. exactly the locked-account case.Chain:
ButtonWithDropdownMenu. When you tap Mark as paid,PopoverMenu.selectItemruns theshouldCallAfterModalHidebranch and calls theonItemSelectedprop before it callsclose()—App/src/components/PopoverMenu/index.tsx
Lines 414 to 421 in e2e13da
onItemSelectedprop isButtonWithDropdownMenu's handler, which synchronously forwards toonSubItemSelected—App/src/components/ButtonWithDropdownMenu/index.tsx
Lines 294 to 299 in e2e13da
MoneyReportHeaderKYCDropdownforwards that toonPaymentSelect→onSelectionModePaymentSelect—App/src/components/MoneyReportHeaderKYCDropdown.tsx
Lines 84 to 98 in e2e13da
shouldBlockAction, and for a locked account immediately callsshowLockedAccountModal()—App/src/hooks/useSelectionModePayment.ts
Lines 122 to 137 in e2e13da
So the
ConfirmModalopens while the popoverModalis still mounted. On iOS that is the freeze; on Android/web modals stack fine — which is why only iOS: App is checked.Structural cause:
shouldCallAfterModalHideis supposed to defer the action until after the popover hides, but it only defers the item's ownonSelectedcallback — theonItemSelectedprop (used by these bulk flows) still fires beforeclose(). The working single-report path proves it:SettlementButtonruns the identicalisAccountLocked → showLockedAccountModalguard inside each option'sonSelected(App/src/components/SettlementButton/index.tsx
Lines 193 to 201 in e2e13da
PopoverMenufires from insideclose(...)after the modal hides — so it never freezes.Every affected path (both route the guard through the synchronous
onSubItemSelected):MoneyReportHeaderKYCDropdown(this report).SearchBulkActionsButtonpasses the same locked-account guard throughonSubItemSelectedtwice —App/src/components/Search/SearchBulkActionsButton.tsx
Lines 164 to 215 in e2e13da
What changes do you think we should make in order to solve the problem?
Make
shouldCallAfterModalHidehonor its contract: defer theonItemSelectedprop until after the popover hides, exactly likeonSelectedalready is. InPopoverMenu.selectItem, move theonItemSelectedcall into theclose()callback:The locked-account modal then opens only after the popover is gone — no stacked iOS modals. This is the single convergence point, so it fixes both the report toolbar and the Search bulk path in one change.
Regression safety: only items already flagged
shouldCallAfterModalHidechange, and they already deferonSelectedto after-hide — so any consumer reading state inonItemSelectedalready expects post-selection timing; items without the flag (the common case) are untouched.Why the one-line fix fails: "just call
showLockedAccountModal" is already there (line 128) — the guard does fire; the freeze is the timing, the modal is shown over the open popover. And relying on the existingshouldCallAfterModalHidedoes nothing here, because it only defersitem.onSelected, while the bulk flows deliver the guard through theonItemSelectedprop, which fires beforeclose().What alternative solutions did you explore? (Optional)
PopoverMenuuntouched and instead defer the guard inside the two bulk consumers — move theisAccountLocked/showLockedAccountModalcheck out ofonSubItemSelectedand into the payment item's deferredonSelected, mirroringSettlementButton. Correct, but must be duplicated at each call site (MoneyReportHeaderKYCDropdown+ bothSearchBulkActionsButtonsites) and misses any futureonSubItemSelectedconsumer.showLockedAccountModalinInteractionManager.runAfterInteractions. Rejected: it papers over the timing without fixing the structural "onItemSelected fires before close," andrunAfterInteractionsis not a reliable "after this modal hid" signal, so it can still race on slow devices.oqildev commentedon Jul 1, 2026
Proposal
What is the root cause of that problem?
This is an iOS native "modal presented on top of a dismissing modal" deadlock.
In the report view, the selection toolbar routes payment selection through
useSelectionModeReportActions. When you tap Pay > Mark as paid in the popover submenu, the popover (a nativeModalon iOS) starts dismissing andonSelectionModePaymentSelectfires. That wrapper checksshouldBlockActionsynchronously, on purpose:App/src/hooks/useSelectionModeReportActions.ts
Lines 217 to 227 in e2e13da
For a locked account,
shouldBlockActionimmediately callsshowLockedAccountModal():App/src/hooks/useSelectionModePayment.ts
Lines 122 to 136 in e2e13da
…and
showLockedAccountModalis just ashowConfirmModal(), i.e. it mounts another modal:App/src/components/LockedAccountModalProvider/index.tsx
Lines 22 to 30 in e2e13da
So the locked-account confirm modal tries to present while the payment popover modal is still animating out. On iOS you cannot present a new modal over a view controller that is mid-dismiss — the presentation never completes and the JS/UI thread hangs, which is the "freeze."
The whole reason the actual payment call
basePaymentSelectis already wrapped inInteractionManager.runAfterInteractions(line 224) is to wait for that popover dismissal before doing navigation/modal work. The block check was deliberately pulled out of that deferral "for immediate modal feedback," and that's exactly what reintroduces the freeze for the locked (and delegate/verify) cases. It's iOS-only because Android/web can stack these modals.What changes do you think we should make in order to solve the problem?
Defer the block check so the locked-account modal is only presented after the popover has finished dismissing. In
useSelectionModeReportActions.onSelectionModePaymentSelect(lines 220-227), move theshouldBlockAction(iouPaymentType)early-return inside theInteractionManager.runAfterInteractionscallback instead of running it synchronously.basePaymentSelect(the baseonSelectionModePaymentSelectfromuseSelectionModePayment) already callsshouldBlockActionitself atApp/src/hooks/useSelectionModePayment.ts
Lines 272 to 297 in e2e13da
This is a timing/hook-layer fix, not a data or render fix — the state (
isAccountLocked) is already correct; only the moment of modal presentation is wrong.One thing to double-check while implementing: the header variant
MoneyReportHeaderSelectionDropdownpassesuseSelectionModePayment's baseonSelectionModePaymentSelectdirectly (App/src/components/MoneyReportHeaderActions/MoneyReportHeaderSelectionDropdown.tsx
Lines 181 to 204 in e2e13da
shouldBlockActionsynchronously and can hit the same freeze on iOS. Deferring the modal presentation at theshouldBlockAction/showLockedAccountModalboundary would cover both entry points.What alternative solutions did you explore? (Optional)
Defer the presentation inside
showLockedAccountModal/useConfirmModalitself (wrapshowConfirmModalinInteractionManager.runAfterInteractions). Rejected: that hook is shared by many unrelated confirm modals that aren't opened from a dismissing popover, so it would add latency everywhere and mask the real cause instead of fixing the specific popover→modal handoff.Gate the deferral behind
getPlatform() === CONST.PLATFORM.IOS(mirroring the existing platform-specific branch inonHoldMenuOpen, lines 200-209). Rejected as unnecessary —InteractionManager.runAfterInteractionsresolves promptly on Android/web, so a single cross-platform deferral keeps the code simpler without a behavioral downside.David-2002065 commentedon Jul 1, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On iOS, selecting all transactions in a payable report →
X selected→Pay→Mark as paidon a locked account freezes the entire app instead of showing the locked-account modal.What is the root cause of that problem?
In the report selection mode, the payment sub-items are rendered by
MoneyReportHeaderKYCDropdown, whoseonSubItemSelectedis wired straight intoPopoverMenu'sonItemSelected:App/src/components/MoneyReportHeaderKYCDropdown.tsx
Lines 85 to 98 in a97126c
For a leaf sub-item flagged
shouldCallAfterModalHide,PopoverMenu.selectItemcallsonItemSelectedsynchronously, before the popover is closed — only the item's ownonSelectedis deferred to after the modal hides:App/src/components/PopoverMenu/index.tsx
Lines 414 to 422 in a97126c
So
onSubItemSelected→onPaymentSelect→onSelectionModePaymentSelect→shouldBlockActionruns while the payment popover is still mounted, and it shows the locked-accountConfirmModalimmediately:App/src/hooks/useSelectionModePayment.ts
Lines 122 to 136 in a97126c
On iOS this mounts a second native modal on top of the still-open popover modal. Two overlapping RN modals deadlock the presentation and the app freezes.
For comparison,
SettlementButtonruns the exact same guard from each payment option's deferredonSelected(which fires only after the popover has hidden), so it never overlaps modals and works fine:App/src/components/SettlementButton/index.tsx
Lines 333 to 344 in a97126c
What changes do you think we should make in order to solve the problem?
Defer the guard modals in
shouldBlockActionso they mount only after the payment popover finishes dismissing, while still blocking the payment synchronously. Insrc/hooks/useSelectionModePayment.ts:shouldBlockActionstill returnstrueimmediately so the payment is stopped, but theConfirmModalis presented after the popover's dismiss interaction completes — only one native modal is ever on screen at a time. TheVERIFY_ACCOUNTbranch is a navigation, not a modal, so it doesn't need deferring.What specific scenarios should we cover in automated tests to prevent reintroducing this in the future?
shouldBlockActionfrom the selection-mode pay flow returnstrueand schedulesshowLockedAccountModalviaInteractionManager.runAfterInteractions(assert the modal is shown after interactions flush, not synchronously).showDelegateNoAccessModal).falseand shows no modal.What alternative solutions did you explore? (Optional)
Restructure
MoneyReportHeaderKYCDropdownso each payment sub-item carries its guard in the deferredonSelectedcallback (the patternSettlementButtonalready uses) instead of the synchronousonSubItemSelected. This is the more structural fix but larger, since the sub-items needtriggerKYCFlow/eventthreaded from theKYCWallrender prop into each item. Another option is to flush a pending guard action from the popover'sonOptionsMenuHide, but that adds ref-plumbing for the same effect the deferred call achieves directly.KJ21-ENG commentedon Jul 1, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-07-01 06:42:56 UTC.
Proposal
What is the root cause of that problem?
The selected-expense pay menu is trying to show the locked-account modal from inside the dropdown item-selection callback, before the dropdown/submenu has actually finished closing.
ButtonWithDropdownMenumarks dropdown items and subitems withshouldCallAfterModalHide, but itsPopoverMenu.onItemSelectedhandler still invokes the consumer callback (onSubItemSelected) before it hides the menu.PopoverMenualso callsonItemSelectedbefore the delayedclose()callback runs forshouldCallAfterModalHideitems, so subitem consumers can run too early.App/src/components/ButtonWithDropdownMenu/index.tsx
Lines 294 to 328 in a97126c
App/src/components/PopoverMenu/index.tsx
Lines 414 to 422 in a97126c
In this selected-expense payment flow, that early subitem callback calls
onSelectionModePaymentSelect. On mobile it immediately runsshouldBlockAction(), and locked accounts make that guard callshowLockedAccountModal(). That opens a second modal while the pay dropdown is still closing, which matches the iOS freeze/splash behavior instead of the locked-account modal appearing cleanly.App/src/hooks/useSelectionModeReportActions.ts
Lines 217 to 226 in a97126c
App/src/hooks/useSelectionModePayment.ts
Lines 122 to 130 in a97126c
What changes do you think we should make in order to solve the problem?
Make
ButtonWithDropdownMenuhonorshouldCallAfterModalHidefor the callbacks it owns. When mapping root items and submenu items forPopoverMenu, attach delayedonSelectedhandlers that invokeonOptionSelected/onSubItemSelectedafterPopoverMenu.close()completes, and letonItemSelectedonly update local dropdown state such as the selected index and visible flag.For submenu items, preserve any existing
subItem.onSelectedbehavior, but run it from the same delayed wrapper asonSubItemSelectedso payment subitems do not execute once before close and again after close. This keeps the locked-account guard in the shared payment hook, but ensuresshowLockedAccountModal()runs only after the payment dropdown has been dismissed.App/src/components/ButtonWithDropdownMenu/index.tsx
Lines 294 to 328 in a97126c
Test coverage:
ButtonWithDropdownMenu/PopoverMenuunit test proving a submenu item's consumer callback is not called until after the close callback whenshouldCallAfterModalHideis true.Pay > Mark as paidon a locked account closes the dropdown and then shows the locked-account modal without freezing.Pay > Mark as paidfrom the same selected-expense dropdown.What alternative solutions did you explore? (Optional)
We could special-case locked accounts in
useSelectionModeReportActionsoruseSelectionModePaymentwith anotherInteractionManager.runAfterInteractions()deferral, but that only patches this payment path and leavesButtonWithDropdownMenucontinuing to advertise delayed execution whileonSubItemSelectedbypasses it.melvin-bot commentedon Jul 1, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @rojiphil (
External)58 remaining items
melvin-bot commentedon Aug 4, 2026
@mallenexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
melvin-bot commentedon Aug 6, 2026
@mallenexpensify Huh... This is 4 days overdue. Who can take care of this?
melvin-bot commentedon Aug 10, 2026
@mallenexpensify 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!
melvin-bot commentedon Aug 12, 2026
@mallenexpensify 10 days overdue. Is anyone even seeing these? Hello?
melvin-bot commentedon Aug 14, 2026
@mallenexpensify 12 days overdue. Walking. Toward. The. Light...
melvin-bot commentedon Aug 17, 2026
This issue has not been updated in over 14 days. @rojiphil, @mallenexpensify, @marcaaron, @Krishna2323 eroding to Weekly issue.
situchan commentedon Aug 18, 2026
@mallenexpensify awaiting payment
melvin-bot commentedon Aug 19, 2026
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.
mallenexpensify commentedon Aug 24, 2026
Payment Summary
Contributor: @Krishna2323 due $250 via NewDot
Contributor+: @situchan due $250 via NewDot
^ Test case created. Thx
NO idea how this got missed for over a month. I check
[Due for paymentmany days a week via emails from GH. Apologies (at least it's the only one I've missed that is this old, that I can remember)laurenreidexpensify commentedon Aug 26, 2026
$250 approved for @situchan New Expensify