Repository navigation
Description
Action Performed:
- Go to Spend > Reports
- In the Reports list, click the Pay button on a reimbursable report row (ACH / VBBA payment)
Expected Result:
The first click dispatches the payment and the report is paid.
Actual Result:
The Pay button is unresponsive on the first (and often several subsequent) clicks — nothing happens. Reloading the page and clicking again eventually works. Users have to refresh and click multiple times until a pay finally goes through.
Platforms:
- MacOS / Windows: Chrome (Web)
Root Cause Analysis
The Reports-list Pay button is a SettlementButton (PayActionCell) whose ability to dispatch a pay depends on live Onyx data — the IOU report, the chat report, the policy, and the VBBA bank-account list — none of which live in the search snapshot. On a fresh Reports-list load the row already shows "Pay" (that label comes from the snapshot), but the live data isn't hydrated yet, so early clicks either:
- silently no-op —
confirmPaymentreturns early whenchatReport/reportID/hash/amountare missing (PayActionCell.tsx:81-84), or - fire without a
bankAccountID, which the backend rejects.
A page refresh runs a full Onyx reload that hydrates the data, after which the same click works — exactly the "refresh and click multiple times" behavior reported.
Evidence chain
Client dispatch path (why early clicks do nothing):
- For
action == PAYthe row rendersPayActionCell(aSettlementButton), bypassing the normal action dispatcher —ActionCell/index.tsx:86-98. PayActionCell.confirmPaymentreturns early (no error, no request) whenchatReport/reportID/hash/amountare missing —PayActionCell.tsx:81-84.- Its inputs come from live Onyx, not the snapshot:
iouReportviauseReportWithTransactionsAndViolations(readsCOLLECTION.REPORT—useReportWithTransactionsAndViolations.ts:18-22),policyviausePolicy,bankAccountListviauseOnyx, andchatReport = parentChatReport ?? snapshotChatReport—PayActionCell.tsx:40-77,ExpenseReportListItem.tsx:136-143. canIOUBePaidreturns false for an emptyiouReportor a policy without payments enabled —ReportWorkflow.ts:200-201,ReportWorkflow.ts:247-260— so until the policy/VBBA data loads there's no valid ACH pay option.
Data-flow:
- Search snapshot loads → row shows "Pay" immediately.
- Live
REPORT/POLICY/BANK_ACCOUNT_LISTcollections not yet hydrated for the listed reports. - User clicks Pay →
confirmPaymentearly-returns (nochatReport) or dispatches withoutbankAccountID→ backend rejects. - User refreshes → OpenApp/ReconnectApp reloads Onyx → data hydrated → same click dispatches
PayMoneyRequestwith the bank account → success.
Proposed Fix
In the Reports-list row Pay path, gate the button on the required live Onyx data being loaded instead of letting it silently no-op:
- Show a loading/disabled state (or block the press) while
iouReport,chatReport,policy, andbankAccountListare still hydrating, so users can't click a button that will do nothing. - Ensure the ACH/VBBA
bankAccountIDis resolved before dispatchingPayMoneyRequest. - Alternatively, seed the row's pay from the search snapshot (as the bulk path does) so the row Pay doesn't depend on lazily-loaded collections.
Related
- [Due for payment 2026-08-11] [$250] Bulk Pay / Pay button not responding in MS Edge #94712 — "[$250] Bulk Pay / Pay button not responding in MS Edge". Same symptom family, but that one is Edge + "Mark as paid" (a different code path — bulk
getPayActionCallbackinSearch.ts). This issue is the Chrome + ACH row Pay variant, which works after a refresh.
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022078129670663072953
- Upwork Job ID: 2078129670663072953
- Last Price Increase: 2026-07-24
Activity
ijmalik commentedon Jul 14, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On the Reports list, the "Pay" button on an ACH/VBBA report row is unresponsive on first (and often several) clicks in Chrome — the click either silently no-ops or dispatches a payment without a valid bank account ID that the backend rejects. A page refresh resolves it.
What is the root cause of that problem?
The row renders "Pay" immediately from the Search snapshot's precomputed
actionfield (ActionCell/index.tsx:86-98), but the payment logic inPayActionCell/SettlementButtonreadsiouReport(useReportWithTransactionsAndViolations,src/hooks/useReportWithTransactionsAndViolations.ts:19),policy(usePolicy.ts), andbankAccountList(useOnyx(ONYXKEYS.BANK_ACCOUNT_LIST)) purely from live Onyx, with no fallback to snapshot data — unlikechatReport, which already falls back (ReportListItemHeader.tsx:277,chatReport = parentChatReport ?? snapshotChatReport). Concretely: whileiouReportisundefined,isExpenseReportUtil(iouReport)returnsfalse(ReportUtils.ts:1483-1486), soSettlementButtonskips building the VBBA/business-bank-account option entirely (SettlementButton/index.tsx:321-349, gated onisExpenseReport); separately, even onceiouReport/policyare correct, a still-unhydratedbankAccountListmeans the VBBA option can't be built with a validbankAccountID, so the payment fires but is rejected server-side. A full reload hydrates all three collections and the button starts working.What changes do you think we should make in order to solve the problem?
Split the fix by data source, since they aren't structurally equivalent:
iouReportandpolicy— I confirmed the Search snapshot already embeds full, untrimmedReportandPolicyobjects (src/types/onyx/SearchResults.ts:292-299:SearchResultDataType = PrefixedRecord<ONYXKEYS.COLLECTION.REPORT, Report> & PrefixedRecord<ONYXKEYS.COLLECTION.POLICY, Policy> & ...), keyed identically to live Onyx (report_${id},policy_${id}) — the same shapechatReportalready reads from. No backend change is needed: thread the snapshot's report/policy down throughActionCell → PayActionCell → SettlementButtonand fall back (iouReport ?? snapshotReport,policy ?? snapshotPolicy) exactly likechatReportdoes today.bankAccountList— this is a global, user-scoped key, not per-report, so it cannot come from the snapshot. Gate the button on it instead: whilebankAccountListisundefined, show a loading/disabled state on the Pay button (mirroring the existingisDisabled={isOffline}convention already onKYCWallatSettlementButton/index.tsx:656) and block the press, so a click never fires without a resolvablebankAccountID.I could not find evidence that
bankAccountListis proactively fetched at app boot (no reference inApp.ts's OpenApp/ReconnectApp Onyx data, no loading flag for that key) — I'm not claiming this guard is a rare-case safety net; treat it as the primary gate until someone traces real Onyx state during a repro to confirm otherwise. IfbankAccountListnever resolves (fetch failure), the button stays disabled — the same open-ended limitation already shared by every otherisOffline-gated button in this codebase, not a new failure mode introduced here.What alternative solutions did you explore? (Optional)
Considered snapshot-fallback for
bankAccountListtoo (to fully avoid any loading state) — rejected because it's a global collection with no per-row representation in the snapshot schema, so there's no data to fall back to. Also considered a blanket loading guard on all three collections instead of splitting the fix — rejected becauseiouReport/policygenuinely don't need it once the snapshot fallback is wired up, and gating on them anyway would reintroduce the refresh-like delay for data that's already available immediately.Gaohuilv commentedon Jul 17, 2026
!assign
melvin-bot commentedon Jul 17, 2026
📣 @Gaohuilv! 📣
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:
Fix Expensify#96068: Reports list Pay button (Web Chrome, ACH) unresp…
Fix Expensify#96068: Reports list Pay button (Web Chrome, ACH) unresp…
Gaohuilv commentedon Jul 17, 2026
!assign
melvin-bot commentedon Jul 17, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @DylanDylann (
External)KJ21-ENG commentedon Jul 17, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-07-17 15:18:34 UTC.
Proposal
What is the root cause of that problem?
The Reports row is rendered inside the Search scope, so
PayActionCell's own report and policy hooks are already snapshot-backed. The Search-awareuseOnyxredirects only whitelisted keys such asREPORTandPOLICYto the current snapshot;BANK_ACCOUNT_LISTis not whitelisted and therefore remains a live subscription.App/src/hooks/useOnyx.ts
Lines 73 to 106 in 90ec1a9
App/src/CONST/index.ts
Lines 7426 to 7434 in 90ec1a9
The mismatch happens because
PayActionCellcan compute and display Pay from that snapshot-ready report/policy state, but it rendersSettlementButtonbelowSearchScopeProvider isOnSearch={false}. The nested button and KYC wall therefore build their payment choice from live policy/chat state and the live bank-account list. While those payment inputs are still loading, the short-form Pay control can have no concrete business-bank-account option ormethodID, even though the snapshot row already looks actionable.App/src/components/Search/SearchList/ListItem/ActionCell/PayActionCell.tsx
Lines 41 to 86 in 90ec1a9
App/src/components/Search/SearchList/ListItem/ActionCell/PayActionCell.tsx
Lines 161 to 181 in 90ec1a9
SettlementButtonsubstitutes a generic business-bank-account option when no formatted account is available, while hydrated account options carry the concretemethodID. Its KYC wall also treats an expense report with no open connected account as needing account setup. Because the row does not distinguish "still loading" from "loaded with no account", an early press can be swallowed/diverted or reachpayMoneyRequestwithout the VBBA bank-account ID. Refreshing hydrates the live payment state, so later presses work.App/src/components/SettlementButton/index.tsx
Lines 281 to 357 in 90ec1a9
App/src/components/KYCWall/BaseKYCWall.tsx
Lines 301 to 338 in 90ec1a9
The dispatch path makes the missing ID material:
PayActionCellforwards only the selectedmethodIDfor VBBA, andpayMoneyRequestuses that value asbankAccountID. The existing Search pay callback already demonstrates the correct fallback by usingsnapshotPolicy.achAccount.bankAccountID.App/src/components/Search/SearchList/ListItem/ActionCell/PayActionCell.tsx
Lines 138 to 156 in 90ec1a9
App/src/libs/actions/Search.ts
Lines 557 to 595 in 90ec1a9
What changes do you think we should make in order to solve the problem?
Keep the fix local to the Reports-list Pay path. In
PayActionCell, retain the result metadata from the existingBANK_ACCOUNT_LISTsubscription and combine its loading status with the row's current loading state. While the live account list is loading, renderSettlementButtonas loading/disabled so a visible Pay control cannot accept a press before its payment options are resolvable. Gate on the subscription status, not on an empty value, because a loaded user with no bank account must still reach the existing KYC/setup flow.Do not add duplicate snapshot props for the IOU report and policy: those hooks already resolve through the surrounding Search scope. Also keep the inner live boundary rather than changing every nested
SettlementButtonsubscription to the partial Search snapshot; this preserves the shared button's global workspace, invoice, and onboarding data behavior.When confirming a VBBA payment, resolve the bank-account ID as the selected option's
methodIDfirst and then the snapshot-backed policy'sachAccount.bankAccountID, matching the existing Search pay callback. If the chat report or VBBA ID is still unavailable after loading, pass the existing rowonButtonPressfallback intoPayActionCelland open the report instead of silently returning or dispatching an incomplete request. Pay Elsewhere should continue without a bank-account ID.Test coverage: add a focused
PayActionCelltest under a Search scope with snapshot report/policy data. Verify a loading live bank-account subscription shows a non-actionable loading button and repeated presses issue no request; after hydration, verify the first press issues exactly one VBBA request with both the selected-ID path and policy-ID fallback. Also cover loaded-with-no-account routing to KYC/setup, missing chat/ID opening the report, Pay Elsewhere, and the existing header/deferred action-cell renderings.What alternative solutions did you explore? (Optional)
I considered threading snapshot report/policy objects through every row and settlement call site, but those values are already snapshot-backed in
PayActionCell, so that would duplicate the existing Search-aware hook behavior. I also considered removing the nested live-scope boundary; that would make collection-wide policy reads inside the shared settlement/KYC flow consume a partial Search snapshot, which has a larger and less predictable effect than gating the one live payment dependency and making the VBBA dispatch explicit.mukhrr commentedon Jul 17, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-07-24 00:17:49 UTC.
Proposal
What is the root cause of that problem?
The click never reaches the payment code. It is swallowed by the placeholder that
DeferredActionCellrenders in the Action column.The Reports-list row renders its Action cell through
DeferredActionCell:App/src/components/Search/SearchList/ListItem/ExpenseReportListItemRow/ExpenseReportListItemRowWide.tsx
Lines 249 to 266 in 4a7abbf
DeferredActionCellwithholds the realActionCelluntil a deferred value flips, and until then renders a stand-inButton:App/src/components/Search/SearchList/ListItem/ActionCell/DeferredActionCell.tsx
Lines 20 to 44 in 4a7abbf
That stand-in carries the real action label (
Pay), the samesuccessstyling and the same width, but it isisDisabledwithstyles.pointerEventsNone. It is therefore indistinguishable from a live Pay button while being completely inert, so any press landing on it is silently dropped — no API call, no error, no loading state. Only onceshouldRenderflips doesActionCellmount the realPayActionCell:App/src/components/Search/SearchList/ListItem/ActionCell/index.tsx
Lines 86 to 98 in 4a7abbf
The flip is driven by
useDeferredValue(true, false), which schedules the reveal render on React's transition lane. Transition work yields to every competing higher-priority update, and the Search list produces those continuously (Onyx broadcasts for the search snapshot, report/policy collections, todos, Pusher pushes, row loading state). The inert window is therefore not a fixed frame — it grows with main-thread pressure, and it restarts on every page load. That is exactly the reported behaviour: press Pay, nothing happens; press again, nothing; refresh and keep trying until one press finally lands after the window has closed.Evidence (measured live on the Reports list, Chrome, local dev server)
I sampled the Pay button's computed
pointer-eventsevery animation frame after a cold load, throttling the CPU through CDP to stand in for a heavier account:This is a one-row list, so it is the floor, not the ceiling.
I then drove a real mouse click (not a synthetic dispatch) at the button's coordinates:
pointer-events: none/ opacity0.5→ the payment menu did not open, nothing happened.auto/ opacity1→ the menu opened withPay with business account/Mark as paid.This also rules out "the live Onyx data has not hydrated yet" as the cause of the unresponsiveness: the failing click was at
t = 952 msand the succeeding one about 23 ms later. No report, policy or bank-account collection arrives in 23 ms — the only thing that changed is that the placeholder was replaced by the real cell. The boundary tracks thepointer-eventsflip exactly, and it moves with CPU throttling, which data hydration would not do.How the placeholder became indistinguishable from the real button
The deferral originally rendered an honest skeleton (a
PulsingView), which made the not-ready state obvious and did not invite a press. Commiteb8038d47ffreplaced that skeleton with a disabledButtoncarrying the real action label, and commitefbf5ab16dcmoved the reveal fromuseEffect+startTransitiontouseDeferredValue— both of which schedule on the interruptible transition lane. Together those two changes turned a visible skeleton into a convincing but dead button whose lifetime is unbounded.Because the guard lives in
DeferredActionCell, this affects every row action in Search (Submit and Approve too), but Pay is the one where a dropped press costs the user a payment.What changes do you think we should make in order to solve the problem?
The deferral itself is worth keeping — it keeps the expensive
PayActionCell→SettlementButton→KYCWallsubtree (dozens of Onyx subscriptions per row) out of the list's first paint. What must change is the lane the upgrade runs on, so the inert window is bounded by a single commit instead of by scheduler pressure.The repo already has the hook for precisely this hazard, and its doc comment names it:
App/src/hooks/useRunAfterTransitions.ts
Lines 5 to 24 in 4a7abbf
DeferredSearchAutocompleteListalready adopted it for the same reason:App/src/components/Search/DeferredSearchAutocompleteList/index.native.tsx
Lines 35 to 38 in 4a7abbf
So the change in
DeferredActionCellis to swap the primitive:This keeps the perf intent and improves on it in two ways. When a navigation transition is in flight (opening Spend → Reports),
TransitionTrackerholds the heavy cell back until the animation ends, which is exactly when we want to mount it. When no transition is active, the callback fires synchronously inside the mount effect, so the upgrade lands as a plain, uninterruptible update on the very next render pass rather than whenever the scheduler has a free moment.I verified this red → green in the browser. Re-running the same frame-by-frame sampler after the change, the sampler never observes an inert state at any throttle level — the button is
pointer-events: autofrom its first sampled paint at 1×, 4×, 10× and 20×. At 10× CPU throttling (which previously produced a 415 ms inert window) the first real mouse click opens the payment menu.For regression cover I added
tests/unit/DeferredActionCellTest.tsx, which asserts that the cell upgrades to the pressable action cell so the first press dispatches, and that the upgrade is driven byTransitionTrackerrather than an interruptible transition. The second test fails on currentmain(the transition-lane reveal mounts the real cell regardless of the tracker) and passes with the fix.What alternative solutions did you explore? (Optional)
Restoring the original skeleton placeholder would make the not-ready state honest again, so users would not aim at a dead control. It does not close the window though — the press is still lost — and it reverts a deliberate visual decision.
Having the placeholder capture the press and replay it once the real cell mounts would be airtight, but replaying into
SettlementButtonmeans programmatically reopening its dropdown, which is far more machinery than this bug warrants.Dropping the deferral entirely would fix it too, but it puts the full
SettlementButton+KYCWallsubtree of every visible row back into the list's first paint, which is the cost the deferral exists to avoid.I also checked the theory that the press reaches
confirmPaymentand early-returns on un-hydrated live Onyx data. The 23 ms gap between the failing and succeeding click, and the fact that the window scales with CPU throttling, rule that out as the cause of the unresponsiveness. Whether row Pay should additionally fall back topolicy.achAccount.bankAccountIDwhenmethodIDis absent is a separate question about the payment parameters, not about the button being dead, and is better handled on its own issue.96068-before.mp4
96068-after.mp4
22 remaining items
DylanDylann commentedon Jul 27, 2026
Actually, I think we should do nothing here. Setting CPU throttling to 6× or 20× slowdown to reproduce this doesn't make sense to me, because at that level of throttling, there are lots of similar bugs across our app
lorretheboy commentedon Jul 27, 2026
@DylanDylann I think we have to reduce the performance since our testing device is pretty strong compared to QA's one
DylanDylann commentedon Jul 28, 2026
Hi @mountiny, what are your thoughts on bugs that require lowering the CPU to reproduce? Should we fix them?
mountiny commentedon Jul 28, 2026
Yes, lots of our customer are using low end windows devices so we need to focus on these too
emkhalid commentedon Jul 28, 2026
@DylanDylann I reproduced the bug on 4x CPU throttling. Videos are in my updated proposal — please check it when you get a chance.
DylanDylann commentedon Jul 30, 2026
The Pay button is already disabled, so its unresponsiveness should be intentional, not a bug. Because we're using DeferredActionCell here (see #89083 for an explanation of why we need it). Tbh, I'd still vote to close this issue.
🎀👀🎀 C+ reviewed
melvin-bot commentedon Jul 30, 2026
Triggered auto assignment to @lakchote, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
DylanDylann commentedon Jul 30, 2026
That said, I'd love to keep this discussion open to hear more thoughts, especially from anyone who has an idea that could add real value here. Thank you guys
emkhalid commentedon Jul 30, 2026
@DylanDylann I understand that the Pay button is intentionally disabled while loading. However, clicking it opens the report underneath instead of doing nothing. A disabled button should not trigger a different action, as shown in my video.
Screencast.From.2026-07-29.01-56-32.mp4
lakchote commentedon Jul 30, 2026
@trjExpensify what your thoughts here?
DylanDylann commentedon Jul 31, 2026
Let me elaborate on the problem in more detail. In the video below, I set the CPU throttling to 20x slower to slow things down. When going to the report page, the action button is initially disabled. This is intentional, because we need a heavy computation to render the action button(as I recall, we need to get lots of information to compute all options to pay --> heavy computation). So to avoid impacting the page render, we decided to render the page first and defer rendering the action button by disabling it initially, only enabling it once it's ready.
Screen.Recording.2026-07-31.at.11.53.30.mov
lakchote commentedon Jul 31, 2026
Thanks for the details @DylanDylann, your explanation makes sense to me. Let's close the issue and put our focus elsewhere.