Remove getReportTransactions callers' reliance on the deprecated default (Part 2) - #99656
Conversation
…ult (Part 2) canApprove (ReportPreviewActionUtils.ts) is unexported and its one caller already always supplies transactions, so drop the deprecated-default fallback and make the param required. hasDuplicateTransactions (TransactionUtils.ts) gains a required reportTransactions param, sourced from data its one caller (a hook) already had via useTransactionsAndViolationsForReport.
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
…-getReportTransactions-p2 # Conflicts: # src/libs/ReportPreviewActionUtils.ts
…teTransactions call Codecov flagged 0% patch coverage on PR Expensify#99656 for the line threading transactions into hasDuplicateTransactions. This hook had no test exercising its real implementation before now.
Use require() instead of a static namespace import for ReportUtils spies, since a wildcard import can't be statically proven not to touch the restricted isPaidGroupPolicy/isPaidGroupPolicyExpenseReport exports. Also switch to .at() for array element access per the project's array-access rule.
Array.prototype.at() on a tuple widens to the union of all parameter types, so casting its result back down tripped @typescript-eslint/no-unsafe-type-assertion. Assert the full call args via toHaveBeenCalledWith instead of indexing into mock.calls.
|
@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] |
Addresses CONSISTENCY-16 review bot feedback on PR Expensify#99656.
|
@DylanDylann Could you please check this one when you have a chance? Thanks |
Reviewer Checklist
Screenshots/VideosScreen.Recording.2026-09-11.at.15.53.18.mov |
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
🚧 Valforte 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/Valforte in version: 9.4.78-0 🚀
|
|
🤖 No help site changes required. I did not create a docs PR. Why: This PR is an internal refactor. It threads an existing What I checkedChanged files, all internal:
The two behaviors touched are the report preview Approve action and the Duplicates status bar on an expense report header. Both render exactly as before, since the value passed in is the same data the deprecated fallback produced. The help site describes when those appear, not how the data is fetched, so nothing under I also scanned If you think a specific article does need updating, reply with You asked me to close with the line below. There is no linked help site PR in this case, so treat it as not applicable:
view run · no recording available |
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.4.78-3 🚀
Bundle Size Analysis (Sentry): |
Remove getReportTransactions callers' reliance on the deprecated default (Part 2).
getReportTransactions()falls back to a deprecated global when itsallReportsTransactionsparameter is omitted. This PR migrates two more callers outsideReportUtils.ts.Explanation of Change
Continuation of Part 1 (#99633). Two more callers stop relying on
getReportTransactions's deprecated-default fallback:canApprove(ReportPreviewActionUtils.ts) is not exported and has exactly one caller (getReportPreviewAction, in the same file), which already always suppliestransactions. Thetransactions ?? getReportTransactions(report?.reportID)fallback was dead code in practice, sotransactionsis now a required parameter and the fallback is removed.hasDuplicateTransactions(TransactionUtils/index.ts) gains a requiredreportTransactionsparameter. Its one caller, theuseMoneyReportHeaderStatusBarhook, already computes the same report's transactions viauseTransactionsAndViolationsForReporta few lines above (same underlying derived Onyx valueuseReportTransactionsCollectionreads), so it's passed straight through instead of being recomputed off the deprecated global.Both are pure data-threading changes — no behavior change, since the value now passed in is the same data the deprecated fallback would have produced.
Fixed Issues
$ #66418
PROPOSAL: N/A
Tests
Offline tests
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))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
Screen.Recording.2026-09-04.at.16.17.19.mov
Android: mWeb Chrome
Screen.Recording.2026-09-04.at.16.15.53.mov
iOS: Native
Screen.Recording.2026-09-04.at.16.19.33.mov
iOS: mWeb Safari
Screen.Recording.2026-09-04.at.16.12.51.mov
MacOS: Chrome / Safari
Screen.Recording.2026-09-04.at.16.11.14.mov