Repository navigation
Remove getReportTransactions callers' reliance on the deprecated default in prepareToCleanUpMoneyRequest (Part 11) - #104811
Conversation
Use the iouReportTransactions callers already pass to decide whether deleting the expense empties its report, and thread them through getNavigationUrlOnMoneyRequestDelete and getNavigationUrlAfterTrackExpenseDelete, which previously fell back to an empty list.
…-getReportTransactions-p11 # Conflicts: # src/hooks/useExpenseActions.ts
…eport expenses in tests
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@DylanDylann Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
dylanexpensify
left a comment
There was a problem hiding this comment.
Product input not required for this PR.
|
Since it's not urgent, I'll wait to approve this one until the previous PR is merged to avoid mix-ups and conflicts |
Reviewer Checklist
Screenshots/VideosScreen.Recording.2026-12-01.at.16.16.34.mov |
|
@linhvovan29546 Can you merge the latest main? |
|
🚧 Julesssss has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/Julesssss in version: 9.5.57-0 🚀
|
|
No help site update needed — this PR refactors internal expense-deletion data handling without adding a feature, changing user-facing steps or labels, or making existing article guidance incorrect. |
Explanation of Change
Part 11 of the effort to remove the deprecated,
Onyx.connect-backedgetReportTransactionsglobal (#66418).When an expense is deleted,
prepareToCleanUpMoneyRequestinDeleteMoneyRequest.tsdecides whether it was the last expense on its report (and so whether the report should be deleted too) by callinggetReportTransactions(iouReportID). The function already accepted an optionaliouReportTransactionsparam, anddeleteMoneyRequest/cleanUpMoneyRequestalready required callers to pass it, but this check ignored it. This PR uses it:shouldDeleteIOUReportnow countsiouReportTransactionsinstead of callinggetReportTransactions, and the param is now required (no[]default).getNavigationUrlOnMoneyRequestDeletetakes a newiouReportTransactionsargument (afteriouReport). Before this it left the param out, so it silently got[]. Its callers now pass it:cleanUpMoneyRequestanddeleteMoneyRequestpass the list they already receive.getNavigationUrlAfterTrackExpenseDelete(TrackExpense.ts) takes the same new argument, anddeleteTrackExpensepasses its existingiouReportTransactions.useReportDetailsDeleteModalreadsiouReportTransactionsfromrequestData, which already loads them foriouReport.useExpenseActionsaddsuseReportTransactions(iouReport?.reportID). ItsiouReportcomes from the parent report action, so it may not be the report whose transactions the hook already loads.@typescript-eslint/no-deprecated/getReportTransactionsrow forDeleteMoneyRequest.tsfromeslint.seatbelt.tsv.DeleteMoneyRequestTest.ts: 4 tests create two expenses on a report but passed only[transaction]. They passed before only because the check ignored that value. They now read the report's transactions from Onyx via a smallgetReportTransactionsFromOnyxhelper.No user-facing behavior change is intended.
Fixed Issues
$ #66418
PROPOSAL: N/A
Tests
Offline tests
Same as test
QA Steps
Same as test
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
Screen.Recording.2026-11-16.at.11.21.27.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2026-11-16.at.11.19.00.mov
Screen.Recording.2026-11-16.at.11.18.25.mov
🤖 Generated with Claude Code