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-07] [$250] Invoice - Unable to pay invoice via Pay dropdown buton #95422
When you search type:invoice, each invoice renders as a transaction row, not a grouped report row. That path silently drops the chatReport that the Pay action needs.
Concretely, the transaction row renders the Pay dropdown via TransactionItemRowWide.tsx:319-333, which passes reportID, hash, amount — but never a chatReport prop.
chatReport is undefined, so it returns immediately — payInvoice(...) (PayActionCell.tsx:93-130) is never reached. That is the "nothing happens" symptom.
This is invoice-specific because expense reports render through the grouped-report header ReportListItemHeader.tsx:220, which does pass chatReport. The report/chat-view Pay flow works for the same reason (the invoice room is already loaded and passed in).
Investigation details & evidence chain
type:invoice search has no report grouping, so results render as TransactionListItem → TransactionItemRow → TransactionItemRowWide transaction rows.
"Pay as an individual" → "Mark as paid" (Pay elsewhere) calls onPress({paymentType: ELSEWHERE}) = confirmPayment.
confirmPayment guard returns on !chatReport (PayActionCell.tsx:81-84). No API call fires — silent no-op.
Secondary factor: PayActionCell reads iouReport from live Onyx only (PayActionCell.tsx:46), so even past the guard, isInvoiceReport(iouReport) (line 93) can be false if the report isn't loaded, which would send it down the wrong (payMoneyRequest) branch. invoiceReceiverPolicyID is also derived from chatReport (line 52), so a real chatReport is required for the invoice payload regardless.
Alternatives considered:amount being 0 (ruled out — getReimbursableTotal(report) is non-zero for invoices); a broken payInvoice action (ruled out — it works from the report view and from the bulk-selection hooks useSearchBulkActions/useSelectionModePayment, which key their invoice check on reportID rather than the report object).
Confidence: High — deterministic no-op from a missing prop; the working paths (report-grouped rows, report view, bulk selection) all differ by supplying chatReport/keying on reportID.
What changes do you think we should make in order to solve the problem?
Pass a resolved chatReport into DeferredActionCell in TransactionItemRowWide.tsx:319-333, mirroring what the grouped-report header already does at ReportListItemHeader.tsx:210-221 (resolve from the search snapshot / chatReportID ?? parentReportID). This satisfies the confirmPayment guard and gives payInvoice the room and invoiceReceiverPolicyID it needs.
For robustness, also consider keying the invoice check on reportID (as useSearchBulkActions.ts does) rather than the possibly-unloaded iouReport object, so the correct payInvoice branch is taken even before the report is fully hydrated.
What alternative solutions did you explore? (Optional)
None beyond the above; the fix is localized to the transaction-row Pay wiring.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/95422) 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.
Selecting Pay as an individual → Mark as paid from an invoice transaction’s Search action dropdown does not pay the invoice.
What is the root cause of that problem?
The custom transaction-column query renders the action through TransactionItemRowWide, which passes the report ID, hash, and amount to DeferredActionCell, but not chatReport. ActionCell therefore forwards undefined to PayActionCell.
SettlementButton independently loads the chat report from iouReport.chatReportID, so it can still display the invoice-specific Pay as an individual → Mark as paid submenu. However, after that option calls confirmPayment, PayActionCell immediately returns on !chatReport; consequently, payInvoice() is never called.
What changes do you think we should make in order to solve the problem?
In PayActionCell, restore a local Onyx lookup for the chat report using iouReport?.chatReportID, then resolve paymentChatReport = chatReport ?? liveChatReport. Use that resolved report for eligibility checks, payment context, the guard, report actions, and payInvoice()/payMoneyRequest().
This is a local, safe fallback: report-level Search rows retain their existing snapshot-aware chatReport prop, while transaction rows recover the same live report that SettlementButton already uses. Keep the guard only when neither source resolves a report.
Add a regression test for a transaction-style invoice Search row with no chatReport prop, select Pay as an individual → Mark as paid, and assert that PayInvoice is issued with the invoice and chat report IDs. Manually repeat the reported Chrome flow and verify the paid state/loading update, plus confirm report-level and non-invoice Pay actions remain unchanged.
What alternative solutions did you explore? (Optional)
We could thread parentChatReport from TransactionListItemInner through TransactionListItemWide, TransactionItemRow, and TransactionItemRowWide, but that expands the fix across several generic row components and leaves another prop path that can be omitted; resolving the fallback at the payment boundary is smaller and more robust.
Please re-state the problem that we are trying to solve in this issue.
On Web, when a user opens the Search page with type:invoice results and clicks the row's Pay dropdown → Pay as an individual → Mark as paid, nothing happens. The invoice is not paid and no modal, error, or navigation occurs. Expected: clicking Mark as paid should complete the invoice payment (mark it as settled elsewhere) exactly as it does from the report/preview surface.
What is the root cause of that problem?
PayActionCell.confirmPayment short-circuits before ever calling payInvoice/payMoneyRequest because of an overly strict falsy guard. At src/components/Search/SearchList/ListItem/ActionCell/PayActionCell.tsx:82 the handler does if (!type || !reportID || !hash || !amount || !chatReport) { return; }. The amount prop is fed from reportItem.total at src/components/Search/SearchList/ListItem/ReportListItemHeader.tsx:218 (<ActionCell ... amount={reportItem.total} />), and for invoice search-row snapshots that value can be 0/undefined (and, for receivable invoices, is not guaranteed to be a positive truthy number in the search snapshot). The guard therefore returns silently, so Mark as paid produces no navigation, no API call, and no user feedback — matching the reported symptom exactly.
What changes do you think we should make in order to solve the problem?
src/components/Search/SearchList/ListItem/ReportListItemHeader.tsx:218 — pass the sign-normalized total (already computed on lines 148–155) instead of raw reportItem.total, so the value is consistent with what TotalCell renders and any downstream consumer that does need it (display, analytics) gets the intended magnitude.
Add a defensive fallback in PayActionCell so that when amount is falsy we fall back to getReimbursableTotal(iouReport) (already imported and used for the button's formattedAmount on line 160) — that way any legitimate future consumer of amount still gets a correct value from the live report.
Add a unit/integration test covering: click Pay → Pay as individual → Mark as paid on an invoice search row where reportItem.total is 0/undefined — assert payInvoice is invoked.
What alternative solutions did you explore? (Optional)
PayActionCell receives chatReport only from whatever parent renders ActionCell. In the report-grouped view, ReportListItemHeader derives the chat report and passes it down, so paying works there:
But the repro uses a transaction-list view (columns:...,action, no groupBy), where each row is rendered by TransactionItemRowWide. It mounts the action cell without a chatReport prop:
<DeferredActionCellaction={transactionItem.action}reportID={transactionItem.reportID}policyID={report?.policyID}hash={transactionItem?.hash}amount={getReimbursableTotal(report)}// no chatReport passed/>
So chatReport reaches PayActionCell as undefined, the !chatReport guard trips, and confirmPayment returns before payInvoice is ever called — nothing happens. The other guarded values (type, reportID, hash, amount) are all present; the missing chat report is the sole cause.
What changes do you think we should make in order to solve the problem?
Make PayActionCell self-sufficient so it works no matter which parent mounts it, by falling back to the report's own chatReportID when the chatReport prop isn't supplied. The cell already loads the live report (iouReport) for the row:
Then use resolvedChatReport in place of chatReport inside confirmPayment (the !chatReport guard, the payInvoice/isIndividualInvoiceRoom calls and the chatReportActions lookup, and the payMoneyRequest call). getNonEmptyStringOnyxID, useOnyx and ONYXKEYS are already imported here, so no new dependencies are needed.
This fixes the transaction-list Pay flow (invoices and any other payable row) and leaves the already-working report-grouped path untouched, since it keeps passing the prop.
What alternative solutions did you explore? (Optional)
Thread the prop at the source instead — derive the chat report in TransactionItemRowWide (a useOnyx on report?.chatReportID) and pass chatReport={chatReport} to DeferredActionCell, mirroring ReportListItemHeader. This stays closer to the existing pattern but adds an Onyx read to every transaction row, including non-payable ones, whereas fixing it in PayActionCell confines the extra read to rows that actually render the Pay button.
🚨 Edited by proposal-police: This proposal was edited at 2026-07-06 18:38:45 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
On the Search page in the flat transactions view (e.g. type:invoice with a columns: list), clicking a row's Pay dropdown and choosing "Pay as an individual > Mark as paid" does nothing — no payment, no error, no optimistic update.
What is the root cause of that problem?
The Pay handler on flat Search rows silently early-returns because the chatReport prop is never threaded down that render path.
In the flat (non-grouped) view, each result is a TransactionListItemWide, which renders the shared TransactionItemRow:
TransactionItemRowWide renders the Action column's DeferredActionCell with reportID, hash, amount — but no chatReport. TransactionItemRow doesn't even declare that prop:
), amount = getReimbursableTotal ≠ 0 for a real invoice. chatReport === undefined is the lone failing term — the click deterministically dead-ends before any API call, which is exactly "nothing happens".
Structural cause: PR #92297 deprecated the search-specific PayMoneyRequestOnSearch API (which needed only hash/reportID/amount) in favor of calling payInvoice/payMoneyRequest directly, and those need the full chatReport. The PR threaded chatReport into the two report-grouped views — ReportListItemHeader (
// TransactionItemRowNarrow intentionally omits column sizing, hover, action button, and related table-only props that only the wide layout consumes.
); expanded-group child rows render a View button, not Pay; bulk-selection Pay resolves its own chatReport in useSearchBulkActions and must not change.
What changes do you think we should make in order to solve the problem?
Resolve chatReport inside PayActionCell itself — the single convergence point every per-row Pay goes through — by falling back to the live Onyx report collection it already subscribes to (
functionPayActionCell({...,chatReport: chatReportProp}: PayActionCellProps){// after iouReport / allReports:constchatReport=chatReportProp??allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${getNonEmptyStringOnyxID(iouReport?.chatReportID)}`];
Every downstream read (the guard, canIOUBePaid, invoiceReceiverPolicyID, useReportPaymentContext, both pay calls) keeps using chatReport unchanged, so invoice and expense rows are both fixed at once. Regression safety in one sentence: grouped-view callers that already pass chatReport win via ?? so their behavior is byte-identical, and the fallback reuses the existing allReports subscription — no new Onyx connection.
Why the obvious spot fix fails: threading chatReport as a prop from TransactionListItem/index.tsx down through TransactionListItemWide → TransactionItemRow → TransactionItemRowWide → DeferredActionCell adds a prop to the shared TransactionItemRow, consumed by 10+ non-Search surfaces (MoneyRequestReportTransactionItem, duplicate/merge items, UnreportedExpenseListItem, ...) — and any render path that forgets the new prop reproduces this exact silent failure, which is precisely how #92297 broke it (it prop-threaded two of the three render paths and missed this one). Equally, just deleting !chatReport from the guard does not work: payInvoice/payMoneyRequest dereference chatReport to build the request params, so the call would fail deeper instead of paying.
What alternative solutions did you explore? (Optional)
Thread the chatReport prop down the five-layer chain from TransactionListItem/index.tsx#L141 — correct but a wider diff through a shared component, and it re-creates the miss-a-caller failure mode described above.
Add a search-snapshot fallback (like ReportListItemHeader.tsx#L272) on top of the live-Onyx fallback for reports not yet loaded — cheap follow-up in the PR if wanted; the payer is a participant of the invoice room, so it is in their live Onyx in practice.
Restore the hash-based PayMoneyRequestOnSearch API — intentionally deprecated by #92297; not an option.
🚨 Edited by proposal-police: This proposal was edited at 2026-07-07 20:37:20 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
On Search, when a user runs type:invoice columns:receipt,date,status,merchant,from,category,tag,amount,action and clicks Pay > Pay as an individual > Mark as paid, nothing happens. The dropdown opens and the submenu looks correct, but confirming the payment produces no optimistic update, no API call, and no error. The same invoice can be paid from the report view.
What is the root cause of that problem?
The reported query renders flat transaction rows, not grouped report rows. Each invoice appears through TransactionListItem > TransactionItemRowWide, and the Action column mounts DeferredActionCell > PayActionCell with reportID, hash, and amount, but never passes chatReport:
Grouped report rows (for example ReportListItemHeader) do pass chatReport, which is why Pay works on those paths but fails on the flat invoice transaction path used by this repro.
When the user picks Mark as paid, SettlementButton inside PayActionCell calls confirmPayment. That handler had a hard guard that required the chatReport prop:
On the flat transaction path, chatReport is undefined, so confirmPayment returns immediately. payInvoice() is never called, which matches the silent no-op in the bug report.
Why the Pay menu still appears: SettlementButton loads the invoice room report on its own from iouReport.chatReportID via useOnyx, so it can render invoice-specific options like Pay as an individual > Mark as paid. The menu and the payment handler therefore use different data sources — the menu works, but the handler bails out before dispatching payment.
Why this matters for invoices specifically: paying an invoice is not the same as paying a regular expense report. payInvoice() needs the invoice room (chatReport) for invoiceReceiver / policy context when building the request and optimistic Onyx data (see buildOnyxDataForInvoice in SendInvoice.ts):
Without that chat report, the payment command never runs.
The invoice room report is often still available in the Search snapshot or main Onyx under the invoice report's chatReportID, but PayActionCell never looked it up — it only trusted the missing prop.
What changes do you think we should make in order to solve the problem?
Fix this in PayActionCell.tsx only, at the point where payment is confirmed.
Inside confirmPayment, resolve a chatReportForPayment before the guard, using the same fallback order already used elsewhere for Search pay (getChatReportForSearchPay in Search.ts):
Use the chatReport prop when the parent already passed it (grouped report rows — no behavior change).
Fall back to the Search snapshot: searchData[REPORT + chatReportID].
Fall back to live Onyx: getReportOrDraftReport(chatReportID).
chatReportID comes from iouReport.chatReportID ?? iouReport.parentReportID.
Then replace the guard and all payment calls to use chatReportForPayment instead of the raw chatReport prop:
Pass chatReportForPayment into payInvoice() / payMoneyRequest() and the related lookups inside confirmPayment (B2B invoice report selection, report actions key, etc.).
This keeps the existing invoice payment API unchanged and only ensures Search passes the invoice room context that payInvoice already expects.
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
When paying from type:invoice search results, the action column renders PayActionCell, which wraps SettlementButton for the Pay dropdown. Clicking Pay as individual → Mark as paid calls confirmPayment in PayActionCell.
confirmPayment returns immediately when chatReport is falsy:
Invoice search uses transaction rows (TransactionListItem → TransactionItemRowWide), and that path never passes chatReport into DeferredActionCell / PayActionCell. So chatReport is always undefined on this path.
The Pay dropdown still appears because SettlementButton loads the chat report itself from Onyx via iouReport.chatReportID. The menu renders, but the payment handler no-ops — matching the bug report (“Nothing happens after clicking Mark as paid”).
This regressed when search Pay moved to an inline SettlementButton dropdown via PayActionCell (PR #91289) without resolving chatReport on the transaction-row path. Expense-report rows were fixed separately (commit b00b27716f37) by passing chatReport from the parent, but invoice transaction rows were not.
What changes do you think we should make in order to solve the problem?
In PayActionCell.tsx only:
Resolve a resolvedChatReport when the prop is missing:
Load from Onyx using iouReport.chatReportID (same as SettlementButton)
Fall back to the search snapshot chat report (chatReportID ?? parentReportID), matching existing getChatReportForSearchPay logic in Search.ts
Relax the confirmPayment guard to match useSelectionModePayment:
Require type, reportID, and resolvedChatReport
Fall back hash to currentSearchHash from search context
Drop the !amount check (amount is unused downstream and can be 0)
Pass resolvedChatReport into payInvoice / payMoneyRequest and existing eligibility checks.
Add a unit test proving payInvoice is invoked when chatReport prop is omitted but Onyx/snapshot chat report data exists.
What alternative solutions did you explore? (Optional)
Plumb chatReport through TransactionListItem → TransactionItemRow → ActionCell: Matches the expense-report fix pattern but touches 5+ files; unnecessary when PayActionCell can self-resolve like SettlementButton already does.
Export and reuse getChatReportForSearchPay from Search.ts: Correct but adds API surface; inline snapshot fallback in PayActionCell is sufficient for this bug.
[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: N/A
[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 Jul 6, 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/2d0f10affa9aa19c839efeebaa5f4eccdfcedd5d1b36a28b1b228e9e8151626d
MelvinBot commentedon Jul 6, 2026
Proposal
What is the root cause of that problem?
When you search
type:invoice, each invoice renders as a transaction row, not a grouped report row. That path silently drops thechatReportthat the Pay action needs.Concretely, the transaction row renders the Pay dropdown via
TransactionItemRowWide.tsx:319-333, which passesreportID,hash,amount— but never achatReportprop.When "Mark as paid" is clicked,
PayActionCell.confirmPaymenthits its first guard:chatReportisundefined, so it returns immediately —payInvoice(...)(PayActionCell.tsx:93-130) is never reached. That is the "nothing happens" symptom.This is invoice-specific because expense reports render through the grouped-report header
ReportListItemHeader.tsx:220, which does passchatReport. The report/chat-view Pay flow works for the same reason (the invoice room is already loaded and passed in).Investigation details & evidence chain
type:invoicesearch has no report grouping, so results render asTransactionListItem→TransactionItemRow→TransactionItemRowWidetransaction rows.DeferredActionCell→PayActionCellwithoutchatReport(TransactionItemRowWide.tsx:319-333).onPress({paymentType: ELSEWHERE})=confirmPayment.confirmPaymentguard returns on!chatReport(PayActionCell.tsx:81-84). No API call fires — silent no-op.PayActionCellreadsiouReportfrom live Onyx only (PayActionCell.tsx:46), so even past the guard,isInvoiceReport(iouReport)(line 93) can befalseif the report isn't loaded, which would send it down the wrong (payMoneyRequest) branch.invoiceReceiverPolicyIDis also derived fromchatReport(line 52), so a realchatReportis required for the invoice payload regardless.Alternatives considered:
amountbeing 0 (ruled out —getReimbursableTotal(report)is non-zero for invoices); a brokenpayInvoiceaction (ruled out — it works from the report view and from the bulk-selection hooksuseSearchBulkActions/useSelectionModePayment, which key their invoice check onreportIDrather than the report object).Confidence: High — deterministic no-op from a missing prop; the working paths (report-grouped rows, report view, bulk selection) all differ by supplying
chatReport/keying onreportID.What changes do you think we should make in order to solve the problem?
Pass a resolved
chatReportintoDeferredActionCellinTransactionItemRowWide.tsx:319-333, mirroring what the grouped-report header already does atReportListItemHeader.tsx:210-221(resolve from the search snapshot /chatReportID??parentReportID). This satisfies theconfirmPaymentguard and givespayInvoicethe room andinvoiceReceiverPolicyIDit needs.For robustness, also consider keying the invoice check on
reportID(asuseSearchBulkActions.tsdoes) rather than the possibly-unloadediouReportobject, so the correctpayInvoicebranch is taken even before the report is fully hydrated.What alternative solutions did you explore? (Optional)
None beyond the above; the fix is localized to the transaction-row Pay wiring.
Possibly related issues
Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/95422)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
kitvasyl commentedon Jul 6, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
Selecting Pay as an individual → Mark as paid from an invoice transaction’s Search action dropdown does not pay the invoice.
What is the root cause of that problem?
The custom transaction-column query renders the action through
TransactionItemRowWide, which passes the report ID, hash, and amount toDeferredActionCell, but notchatReport.ActionCelltherefore forwardsundefinedtoPayActionCell.SettlementButtonindependently loads the chat report fromiouReport.chatReportID, so it can still display the invoice-specific Pay as an individual → Mark as paid submenu. However, after that option callsconfirmPayment,PayActionCellimmediately returns on!chatReport; consequently,payInvoice()is never called.What changes do you think we should make in order to solve the problem?
In
PayActionCell, restore a local Onyx lookup for the chat report usingiouReport?.chatReportID, then resolvepaymentChatReport = chatReport ?? liveChatReport. Use that resolved report for eligibility checks, payment context, the guard, report actions, andpayInvoice()/payMoneyRequest().This is a local, safe fallback: report-level Search rows retain their existing snapshot-aware
chatReportprop, while transaction rows recover the same live report thatSettlementButtonalready uses. Keep the guard only when neither source resolves a report.Add a regression test for a transaction-style invoice Search row with no
chatReportprop, select Pay as an individual → Mark as paid, and assert thatPayInvoiceis issued with the invoice and chat report IDs. Manually repeat the reported Chrome flow and verify the paid state/loading update, plus confirm report-level and non-invoice Pay actions remain unchanged.What alternative solutions did you explore? (Optional)
We could thread
parentChatReportfromTransactionListItemInnerthroughTransactionListItemWide,TransactionItemRow, andTransactionItemRowWide, but that expands the fix across several generic row components and leaves another prop path that can be omitted; resolving the fallback at the payment boundary is smaller and more robust.aswin-s commentedon Jul 6, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On Web, when a user opens the Search page with
type:invoiceresults and clicks the row's Pay dropdown → Pay as an individual → Mark as paid, nothing happens. The invoice is not paid and no modal, error, or navigation occurs. Expected: clicking Mark as paid should complete the invoice payment (mark it as settled elsewhere) exactly as it does from the report/preview surface.What is the root cause of that problem?
PayActionCell.confirmPaymentshort-circuits before ever callingpayInvoice/payMoneyRequestbecause of an overly strict falsy guard. At src/components/Search/SearchList/ListItem/ActionCell/PayActionCell.tsx:82 the handler doesif (!type || !reportID || !hash || !amount || !chatReport) { return; }. Theamountprop is fed fromreportItem.totalat src/components/Search/SearchList/ListItem/ReportListItemHeader.tsx:218 (<ActionCell ... amount={reportItem.total} />), and for invoice search-row snapshots that value can be0/undefined(and, for receivable invoices, is not guaranteed to be a positive truthy number in the search snapshot). The guard therefore returns silently, soMark as paidproduces no navigation, no API call, and no user feedback — matching the reported symptom exactly.What changes do you think we should make in order to solve the problem?
!amountfrom the early-return guard (or replace it withamount === undefinedonly).amountis not needed to dispatchpayInvoice/payMoneyRequest— neither call reads it — so it must not gate the click.total(already computed on lines 148–155) instead of rawreportItem.total, so the value is consistent with whatTotalCellrenders and any downstream consumer that does need it (display, analytics) gets the intended magnitude.PayActionCellso that whenamountis falsy we fall back togetReimbursableTotal(iouReport)(already imported and used for the button'sformattedAmounton line 160) — that way any legitimate future consumer ofamountstill gets a correct value from the live report.Pay → Pay as individual → Mark as paidon an invoice search row wherereportItem.totalis0/undefined— assertpayInvoiceis invoked.What alternative solutions did you explore? (Optional)
David-2002065 commentedon Jul 6, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-07-06 18:38:58 UTC.
Proposal
What is the root cause of that problem?
The per-row Pay dropdown in Search is rendered by
PayActionCell, whoseconfirmPaymenthandler returns early ifchatReportis missing:App/src/components/Search/SearchList/ListItem/ActionCell/PayActionCell.tsx
Lines 81 to 85 in 1908f68
PayActionCellreceiveschatReportonly from whatever parent rendersActionCell. In the report-grouped view,ReportListItemHeaderderives the chat report and passes it down, so paying works there:App/src/components/Search/SearchList/ListItem/ReportListItemHeader.tsx
Lines 210 to 222 in 1908f68
But the repro uses a transaction-list view (
columns:...,action, nogroupBy), where each row is rendered byTransactionItemRowWide. It mounts the action cell without achatReportprop:App/src/components/TransactionItemRow/TransactionItemRowWide.tsx
Lines 319 to 333 in 1908f68
So
chatReportreachesPayActionCellasundefined, the!chatReportguard trips, andconfirmPaymentreturns beforepayInvoiceis ever called — nothing happens. The other guarded values (type,reportID,hash,amount) are all present; the missing chat report is the sole cause.What changes do you think we should make in order to solve the problem?
Make
PayActionCellself-sufficient so it works no matter which parent mounts it, by falling back to the report's ownchatReportIDwhen thechatReportprop isn't supplied. The cell already loads the live report (iouReport) for the row:App/src/components/Search/SearchList/ListItem/ActionCell/PayActionCell.tsx
Lines 46 to 47 in 1908f68
Add a fallback chat report derived from it:
Then use
resolvedChatReportin place ofchatReportinsideconfirmPayment(the!chatReportguard, thepayInvoice/isIndividualInvoiceRoomcalls and thechatReportActionslookup, and thepayMoneyRequestcall).getNonEmptyStringOnyxID,useOnyxandONYXKEYSare already imported here, so no new dependencies are needed.This fixes the transaction-list Pay flow (invoices and any other payable row) and leaves the already-working report-grouped path untouched, since it keeps passing the prop.
What alternative solutions did you explore? (Optional)
Thread the prop at the source instead — derive the chat report in
TransactionItemRowWide(auseOnyxonreport?.chatReportID) and passchatReport={chatReport}toDeferredActionCell, mirroringReportListItemHeader. This stays closer to the existing pattern but adds an Onyx read to every transaction row, including non-payable ones, whereas fixing it inPayActionCellconfines the extra read to rows that actually render the Pay button.ahmdshrif commentedon Jul 6, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-07-06 18:38:45 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
On the Search page in the flat transactions view (e.g.
type:invoicewith acolumns:list), clicking a row's Pay dropdown and choosing "Pay as an individual > Mark as paid" does nothing — no payment, no error, no optimistic update.What is the root cause of that problem?
The Pay handler on flat Search rows silently early-returns because the
chatReportprop is never threaded down that render path.TransactionListItemWide, which renders the sharedTransactionItemRow:App/src/components/Search/SearchList/ListItem/TransactionListItem/TransactionListItemWide.tsx
Lines 177 to 181 in 1908f68
TransactionItemRowWiderenders the Action column'sDeferredActionCellwithreportID,hash,amount— but nochatReport.TransactionItemRowdoesn't even declare that prop:App/src/components/TransactionItemRow/TransactionItemRowWide.tsx
Lines 313 to 334 in 1908f68
action === PAY,ActionCellforwards the (undefined)chatReporttoPayActionCell:App/src/components/Search/SearchList/ListItem/ActionCell/index.tsx
Lines 86 to 97 in 1908f68
confirmPaymentbails out silently when any guard term is falsy:App/src/components/Search/SearchList/ListItem/ActionCell/PayActionCell.tsx
Lines 81 to 84 in 1908f68
type=ELSEWHERE(Mark as paid),reportIDis on the item,hashis stamped onto every search item (App/src/components/Search/hooks/useSearchSnapshot.ts
Line 335 in 1908f68
amount=getReimbursableTotal≠ 0 for a real invoice.chatReport === undefinedis the lone failing term — the click deterministically dead-ends before any API call, which is exactly "nothing happens".Structural cause: PR
#92297deprecated the search-specificPayMoneyRequestOnSearchAPI (which needed onlyhash/reportID/amount) in favor of callingpayInvoice/payMoneyRequestdirectly, and those need the fullchatReport. The PR threadedchatReportinto the two report-grouped views —ReportListItemHeader(App/src/components/Search/SearchList/ListItem/ReportListItemHeader.tsx
Lines 271 to 277 in 1908f68
ExpenseReportListItem(App/src/components/Search/SearchList/ListItem/ExpenseReportListItem.tsx
Lines 136 to 141 in 1908f68
parentChatReportonly for the non-Pay button handler:App/src/components/Search/SearchList/ListItem/TransactionListItem/index.tsx
Line 141 in 1908f68
Affected paths:
payInvoicebranch is unreachable (the reported bug):App/src/components/Search/SearchList/ListItem/ActionCell/PayActionCell.tsx
Lines 109 to 129 in 1908f68
payMoneyRequestbranch dead-ends identically:App/src/components/Search/SearchList/ListItem/ActionCell/PayActionCell.tsx
Lines 132 to 151 in 1908f68
canIOUBePaidon flat rows also evaluates withchatReport = undefined, so the dropdown's pay-elsewhere-only logic is computed from wrong inputs:App/src/components/Search/SearchList/ListItem/ActionCell/PayActionCell.tsx
Lines 75 to 77 in 1908f68
App/src/components/TransactionItemRow/index.tsx
Line 142 in 1908f68
chatReportinuseSearchBulkActionsand must not change.What changes do you think we should make in order to solve the problem?
Resolve
chatReportinsidePayActionCellitself — the single convergence point every per-row Pay goes through — by falling back to the live Onyx report collection it already subscribes to (App/src/components/Search/SearchList/ListItem/ActionCell/PayActionCell.tsx
Line 49 in 1908f68
iouReport.chatReportID:Every downstream read (the guard,
canIOUBePaid,invoiceReceiverPolicyID,useReportPaymentContext, both pay calls) keeps usingchatReportunchanged, so invoice and expense rows are both fixed at once. Regression safety in one sentence: grouped-view callers that already passchatReportwin via??so their behavior is byte-identical, and the fallback reuses the existingallReportssubscription — no new Onyx connection.Why the obvious spot fix fails: threading
chatReportas a prop fromTransactionListItem/index.tsxdown throughTransactionListItemWide → TransactionItemRow → TransactionItemRowWide → DeferredActionCelladds a prop to the sharedTransactionItemRow, consumed by 10+ non-Search surfaces (MoneyRequestReportTransactionItem, duplicate/merge items, UnreportedExpenseListItem, ...) — and any render path that forgets the new prop reproduces this exact silent failure, which is precisely how#92297broke it (it prop-threaded two of the three render paths and missed this one). Equally, just deleting!chatReportfrom the guard does not work:payInvoice/payMoneyRequestdereferencechatReportto build the request params, so the call would fail deeper instead of paying.What alternative solutions did you explore? (Optional)
chatReportprop down the five-layer chain fromTransactionListItem/index.tsx#L141— correct but a wider diff through a shared component, and it re-creates the miss-a-caller failure mode described above.ReportListItemHeader.tsx#L272) on top of the live-Onyx fallback for reports not yet loaded — cheap follow-up in the PR if wanted; the payer is a participant of the invoice room, so it is in their live Onyx in practice.PayMoneyRequestOnSearchAPI — intentionally deprecated by#92297; not an option.samranahm commentedon Jul 6, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-07-07 20:37:20 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
On Search, when a user runs
type:invoice columns:receipt,date,status,merchant,from,category,tag,amount,actionand clicks Pay > Pay as an individual > Mark as paid, nothing happens. The dropdown opens and the submenu looks correct, but confirming the payment produces no optimistic update, no API call, and no error. The same invoice can be paid from the report view.What is the root cause of that problem?
The reported query renders flat transaction rows, not grouped report rows. Each invoice appears through
TransactionListItem>TransactionItemRowWide, and the Action column mountsDeferredActionCell>PayActionCellwithreportID,hash, andamount, but never passeschatReport:App/src/components/TransactionItemRow/TransactionItemRowWide.tsx
Lines 320 to 332 in c08f57f
Grouped report rows (for example
ReportListItemHeader) do passchatReport, which is why Pay works on those paths but fails on the flat invoice transaction path used by this repro.When the user picks Mark as paid,
SettlementButtoninsidePayActionCellcallsconfirmPayment. That handler had a hard guard that required thechatReportprop:App/src/components/Search/SearchList/ListItem/ActionCell/PayActionCell.tsx
Lines 81 to 84 in c08f57f
On the flat transaction path,
chatReportisundefined, soconfirmPaymentreturns immediately.payInvoice()is never called, which matches the silent no-op in the bug report.Why the Pay menu still appears:
SettlementButtonloads the invoice room report on its own fromiouReport.chatReportIDviauseOnyx, so it can render invoice-specific options like Pay as an individual > Mark as paid. The menu and the payment handler therefore use different data sources — the menu works, but the handler bails out before dispatching payment.Why this matters for invoices specifically: paying an invoice is not the same as paying a regular expense report.
payInvoice()needs the invoice room (chatReport) forinvoiceReceiver/ policy context when building the request and optimistic Onyx data (seebuildOnyxDataForInvoiceinSendInvoice.ts):App/src/libs/actions/IOU/SendInvoice.ts
Line 126 in c08f57f
Without that chat report, the payment command never runs.
The invoice room report is often still available in the Search snapshot or main Onyx under the invoice report's
chatReportID, butPayActionCellnever looked it up — it only trusted the missing prop.What changes do you think we should make in order to solve the problem?
Fix this in
PayActionCell.tsxonly, at the point where payment is confirmed.Inside
confirmPayment, resolve achatReportForPaymentbefore the guard, using the same fallback order already used elsewhere for Search pay (getChatReportForSearchPayinSearch.ts):chatReportprop when the parent already passed it (grouped report rows — no behavior change).searchData[REPORT + chatReportID].getReportOrDraftReport(chatReportID).chatReportIDcomes fromiouReport.chatReportID ?? iouReport.parentReportID.Then replace the guard and all payment calls to use
chatReportForPaymentinstead of the rawchatReportprop:Pass
chatReportForPaymentintopayInvoice()/payMoneyRequest()and the related lookups insideconfirmPayment(B2B invoice report selection, report actions key, etc.).This keeps the existing invoice payment API unchanged and only ensures Search passes the invoice room context that
payInvoicealready expects.What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
Solution verified
Kapture.2026-07-08.at.01.29.22.mp4
melvin-bot commentedon Jul 6, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Pujan92 (
External)neerajbachani commentedon Jul 6, 2026
Proposal
What is the root cause of that problem?
When paying from
type:invoicesearch results, the action column rendersPayActionCell, which wrapsSettlementButtonfor the Pay dropdown. Clicking Pay as individual → Mark as paid callsconfirmPaymentinPayActionCell.confirmPaymentreturns immediately whenchatReportis falsy:PayActionCell.tsx—if (!type || !reportID || !hash || !amount || !chatReport) { return; }Invoice search uses transaction rows (
TransactionListItem→TransactionItemRowWide), and that path never passeschatReportintoDeferredActionCell/PayActionCell. SochatReportis alwaysundefinedon this path.The Pay dropdown still appears because
SettlementButtonloads the chat report itself from Onyx viaiouReport.chatReportID. The menu renders, but the payment handler no-ops — matching the bug report (“Nothing happens after clicking Mark as paid”).This regressed when search Pay moved to an inline
SettlementButtondropdown viaPayActionCell(PR #91289) without resolvingchatReporton the transaction-row path. Expense-report rows were fixed separately (commitb00b27716f37) by passingchatReportfrom the parent, but invoice transaction rows were not.What changes do you think we should make in order to solve the problem?
In
PayActionCell.tsxonly:Resolve a
resolvedChatReportwhen the prop is missing:iouReport.chatReportID(same asSettlementButton)chatReportID ?? parentReportID), matching existinggetChatReportForSearchPaylogic inSearch.tsRelax the
confirmPaymentguard to matchuseSelectionModePayment:type,reportID, andresolvedChatReporthashtocurrentSearchHashfrom search context!amountcheck (amount is unused downstream and can be0)Pass
resolvedChatReportintopayInvoice/payMoneyRequestand existing eligibility checks.Add a unit test proving
payInvoiceis invoked whenchatReportprop is omitted but Onyx/snapshot chat report data exists.What alternative solutions did you explore? (Optional)
chatReportthroughTransactionListItem→TransactionItemRow→ActionCell: Matches the expense-report fix pattern but touches 5+ files; unnecessary whenPayActionCellcan self-resolve likeSettlementButtonalready does.getChatReportForSearchPayfromSearch.ts: Correct but adds API surface; inline snapshot fallback inPayActionCellis sufficient for this bug.48 remaining items
melvin-bot commentedon Aug 6, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Aug 6, 2026
Payment Summary
Resolving PRs:
Fix invoice Pay from Search transaction rows (resolve chatReport in PayActionCell) #95873
Reviewer: @Pujan92 owed $250 via NewDot
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon Aug 10, 2026
Payment Summary
Contributor+: @Pujan92 due $250 via NewDot
@Pujan92 plz complete the BZ checklist and tag me in a post once you have. Thx
Pujan92 commentedon Aug 11, 2026
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: [CP Staging] Fix pay report on Spend #93308 (comment)
[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: N/A
[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/673465
Regression Test Proposal
type:invoice columns:receipt,date,status,merchant,from,category,tag,amount,action.Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-3f2f-a2de-467f-4ea3448f06d4twisterdotcom commentedon Aug 11, 2026
$250 approved for @Pujan92 in Report ID: R000hsjQYbUb.
Zapier Logs
Run ID: 00040eee-ad93-aa65-8612-705e494c3824SO: https://stackoverflowteams.com/c/expensify/questions/7582
melvin-bot commentedon Aug 18, 2026
@mallenexpensify Huh... This is 4 days overdue. Who can take care of this?