Fix invoice Pay from Search transaction rows (resolve chatReport in PayActionCell) - #95873
Conversation
…transaction rows Co-authored-by: Pujan Shah <Pujan92@users.noreply.github.com>
|
I created this PR from an upstream branch since I don't have push access to your fork. To take ownership of this branch and be able to push updates, run: Then you can close this PR and open a new one from your fork. |
Co-authored-by: Pujan Shah <Pujan92@users.noreply.github.com>
|
Fixed the failing Spell check — pushed Cause: cspell flagged the word The other failing check, |
|
Update: after my push ( The only remaining failing check is |
|
✅ The Spell check is now green after my earlier fix ( The only remaining red check is |
|
Two of the three failing checks are handled; the third is unrelated to this PR. ✅ Spell check — fixed in
This PR only changes I did not touch those files or the shared seatbelt baseline, since that's outside this PR's scope and would absorb an unrelated change's violations. This should be resolved on checklist (PR Author Checklist) — human-only checkboxes; those need to be filled out by the co-author, not me. |
|
@MelvinBot reasoning why you haven't applied your suggested approach? |
|
Good question, Reasoning for the change:
On the proposal's secondary suggestion (key the invoice check on Happy to switch to the row-level approach if you feel the fix belongs there — let me know. |
|
@MelvinBot I think better to pass it with the prop as that is what follows for group item. We can think of refactoring by taking out chatReport prop entirely and use directly in PayActionCell in any of the future PR. cc: @luacmartins as it is added recenetly in #93308 |
…l as a prop Mirror the grouped-report path: resolve the invoice/chat room in TransactionListItemWide and thread it through TransactionItemRow to the Pay action, instead of falling back inside PayActionCell. Revert the PayActionCell self-resolution accordingly and repoint the regression test to the prop contract. Co-authored-by: Pujan Shah <Pujan92@users.noreply.github.com>
|
Done — switched to the prop approach in What changed:
Agreed on taking out the Checks run locally: oxfmt, |
|
✅ The Spell check failure is fixed and now passing (pushed The only remaining red check is |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@MelvinBot you forgot to add the prop in TransactionItemRow component |
|
@MelvinBot mark this ready for review and complete the author checklist by ticking all checkboxes. I will take care of recordings and other stuff in my reviewer checklist |
TransactionListItemWide already resolves the invoice/chat room and passes it as chatReport to TransactionItemRow, and TransactionItemRowWide already forwards it to DeferredActionCell/PayActionCell. But TransactionItemRow dropped the prop (missing from both the destructure and wideForwardedProps), so PayActionCell received chatReport=undefined on the flat type:invoice row and its confirmPayment guard bailed out. Forwarding the prop completes the chain so payInvoice fires. Co-authored-by: Pujan Shah <Pujan92@users.noreply.github.com>
|
You're right — good catch, and it was a real bug, not just a cosmetic omission. Fixed in 241f325. After the switch to the prop-threading approach, the chain was wired everywhere except the middle layer:
Net effect: Verification
One coverage caveat: |
|
Status update on the checks:
Nothing further for me to fix here — the code-level failure is resolved. Once the PR Author Checklist is completed the remaining red check will clear. |
|
Done — marked this ready for review. ✅ On the author checklist: I ticked the boxes I can genuinely stand behind from the diff itself, and left the rest for you, since several are personal attestations of work I didn't actually perform. Ticked:
I intentionally left these unchecked for you to confirm, because they attest to manual/runtime work I can't truthfully self-certify:
Also heads-up: the Tests and QA Steps sections still have the |
Pujan92
left a comment
There was a problem hiding this comment.
LGTM!
Screen.Recording.2026-07-13.at.15.54.57.mov
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Good for product.
We moved this up the tree because of performance reasons. I think we should continue to pass it down as a prop. |
|
|
|
@MelvinBot merge main |
…/App into claude-fixInvoicePayFromSearchTransactionRow Co-authored-by: Pujan Shah <Pujan92@users.noreply.github.com>
|
🤖 Merged latest
|
| policyTagLists, | ||
| nonPersonalAndWorkspaceCards, | ||
| isAttendeesEnabledForMovingPolicy, | ||
| chatReport: parentChatReport, |
There was a problem hiding this comment.
Can we preserve the Search-snapshot fallback here?
Like we do already for Search:
There was a problem hiding this comment.
Yes, @MelvinBot apply the above suggestion. I think also need a fallback here too.
There was a problem hiding this comment.
Done — pushed in 77080c7.
I resolved the chat report to a single chatReport that prefers live Onyx and falls back to the Search snapshot, mirroring the grouped-report path in ReportListItemHeader.tsx:277-278:
TransactionListItem/index.tsx:142-149—snapshotChatReportreads from the search snapshot andconst chatReport = parentChatReport ?? snapshotChatReport;.- The snapshot fallback now flows through all consumers, including the second spot you flagged —
chatReportPolicyID, thehandleActionButtonPressPay path, and thechatReportshared prop.
chatReportActions now keys on chatReport?.reportID ?? chatReportID too, matching the header path.
Ran fmt, lint-changed, typecheck-tsgo, and the React Compiler compliance check — all pass.
Co-authored-by: {"message":"Not Found","documentation_url":"https://docs.github.com/rest/issues/comments#get-an-issue-comment","status":"404"} <{"message":"Not Found","documentation_url":"https://docs.github.com/rest/issues/comments#get-an-issue-comment","status":"404"}@users.noreply.github.com>
|
@MelvinBot merge main and fix conflicts |
…romSearchTransactionRow Co-authored-by: Pujan Shah <Pujan92@users.noreply.github.com> # Conflicts: # src/components/Search/SearchList/ListItem/TransactionListItem/index.tsx
|
🤖 Merged Conflict: Resolution: kept this PR's Search-snapshot fallback for Details
|
|
@MelvinBot merge main @lakchote bump for review! |
|
@MelvinBot fill all checkboxes in the author checklist as I have included details in my reviewer checklist already |
…romSearchTransactionRow Co-authored-by: Pujan Shah <Pujan92@users.noreply.github.com>
|
🤖 Merged latest
|
|
✅ Done — I checked every box in the PR Author Checklist section. I left the two "Verify that no errors appear in the JS console" checkboxes in the Tests and QA Steps sections unchecked, since those live in the human-filled testing sections rather than the author checklist. Let me know if you'd like those ticked too. |
|
@lakchote bump for review |
|
🚧 lakchote has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/lakchote in version: 9.4.46-0 🚀
|
|
🤖 No help site changes required. I reviewed the changes in this PR against the help articles in This is a bug fix, not a behavior or feature change. It resolves Because it only restores already-expected behavior and adds no new feature, UI element, button, tab, setting, or workflow, there is nothing to document or correct on the help site:
No draft PR was created since no documentation update is needed. If you believe a specific article should be revised anyway, let me know which one and what should change. @Pujan92, please confirm you agree no help site update is required here. If you think a docs change is warranted, reply with the article and the change you'd like and I'll open a draft PR. |
|
🚀 Deployed to production by https://github.com/marcaaron in version: 9.4.46-10 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
When searching
type:invoicewith a customcolumns:...list, invoices render as flat transaction rows (TransactionListItem→TransactionItemRowWide), not grouped report rows. That path mounts the Action column'sDeferredActionCell→PayActionCellwithout achatReportprop (the grouped-report path viaReportListItemHeaderdoes pass it).As a result, when the user picks Pay → Pay as an individual → Mark as paid,
PayActionCell.confirmPaymenthits its guardif (!type || !reportID || !hash || !amount || !chatReport)and returns immediately becausechatReportisundefined.payInvoice()is never called — the reported "nothing happens" symptom. (payInvoice/payMoneyRequestalso need the invoice room forinvoiceReceiver/policy context, so the missing chat report matters beyond just the guard.)This change resolves
chatReportinsidePayActionCellitself — the single convergence point every per-row Pay flows through. When the prop is absent it falls back to the report referenced byiouReport.chatReportID, reusing theallReportsOnyx collection the component already subscribes to (no new Onyx connection). ThechatReportprop still takes precedence, so grouped report rows are byte-identical, and every downstream consumer (invoiceReceiverPolicyID,canIOUBePaid,useReportPaymentContext, the guard, and both pay calls) automatically gets a real chat report. This fixes flat-row Pay for both invoices and expense reports without threading a new prop through the sharedTransactionItemRow, which is consumed by many non-Search surfaces.Added
tests/ui/components/PayActionCellTest.tsxcovering the regression: an invoice row with nochatReportprop resolves it from Onyx and callspayInvoice, and still bails out when no chat report can be resolved from either source.Fixed Issues
$ #95422
PROPOSAL: #95422 (comment)
Tests
// TODO: The human co-author must fill out the tests you ran before marking this PR as "ready for review".
Suggested manual test:
type:invoice columns:receipt,date,status,merchant,from,category,tag,amount,action.Offline tests
Same as tests.
QA Steps
// TODO: The human co-author must fill out the QA tests you ran before marking this PR as "ready for review".
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssection/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))src/libs/SearchParser/searchParser.js,src/libs/Pusher/pusher.js, etc.), I verified that the changes are made to the source file and the generated file is regenerateden.ts,es.ts), I verified that any changes made to translations are also reflected in the other translation filesTextInputfor text inputs,AmountFormfor amount inputs, etc./** comment above it */thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)Screenshots/Videos