Repository navigation
[Phase 2] Part 3 - Migrate deprecatedGetReportName -> getReportName in ReportUtils libs - #98046
Conversation
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.
|
|
@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] |
|
PR doesn’t need product input as a refactor PR. Unassigning and unsubscribing myself. |
|
|
||
| const message = getMovedTransactionMessage(translate, action, reportAttributes); | ||
| const derivedReportName = useDerivedReportNameByReportID(fromReportID); | ||
| const message = getMovedTransactionMessage(translate, action, derivedReportName); |
There was a problem hiding this comment.
To avoid duplication, let's pass fromReport and parseMovedTransactionReportIDs(action).fromReportID instead of action
There was a problem hiding this comment.
@DylanDylann, can you elaborate on "duplication"? I thought what we did currently already avoids duplication on how we get fromReport or toReport
There was a problem hiding this comment.
let's pass fromReport and parseMovedTransactionReportIDs(action).fromReportID instead of action
@hoangzinh We call parseMovedTransactionReportIDs twice
There was a problem hiding this comment.
Thanks! I went with a slightly different shape — passing fromReport alone doesn't quite cover it:
- The original logic resolves the report as
fromReport ?? toReport— whenfromReportIDisundefined, the name has to come fromtoReport. SofromReporton its own would break that case. - Fixing that by also passing
toReportmeans thefromReportID ?? toReportIDselection gets repeated at every caller — more duplication, not less. - And
SidebarUtils/OptionsListUtilsare plain lib files, so they can't read the report viauseOnyxat all — their only option isgetReportOrDraftReport/deprecatedAllReports, which read from the JS memory cache instead of Onyx and so don't re-render when the report updates.
Instead:
// callers with useOnyx pass movedReport; others pass IDs and the function falls back internally
getMovedTransactionMessage({translate, movedReport?, toReportID?, fromReportID?, derivedReportName?})
// resolved ID returned here, so the ?? logic lives in one place
parseMovedTransactionReportIDs(action) // => {toReportID, fromReportID, displayReportID}Applied here: f82c430
…tring Add parseMovedTransactionReportIDs, getMovedTransactionReportID and getUnreportedTransactionReportID, and narrow getMovedTransactionMessage / getUnreportedTransactionMessage to take a precomputed derivedReportName string instead of the whole reportAttributes Record. MovedTransactionAction and UnreportedTransactionAction now source that single name via useDerivedReportNameByReportID, dropping their whole-Record useReportAttributes() subscription. The remaining callers (OptionsListUtils, SidebarUtils, ReportNameUtils, ContextMenuActions) extract the one report's name before calling, and are otherwise unchanged. getChatListItemReportName and getReportPreviewMessageForCopy keep their deprecatedGetReportName path for now; they are narrowed in the follow-up PR. Part of Expensify#66427 Phase 2.
…TransactionReportIDs Remove getMovedTransactionReportID and getUnreportedTransactionReportID wrappers. Callers now destructure parseMovedTransactionReportIDs directly. Refactor getMovedTransactionMessage to accept an options object with optional movedReport for component-level Onyx data.
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running: npx bun ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
|
|
|
This PR adds a new |
6088de9 to
f82c430
Compare
| const isPendingDelete = fromReport?.pendingFields?.preview === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE; | ||
| const unreportedTransactionMessage = getUnreportedTransactionMessage(translate, action, reportAttributes); | ||
| const derivedReportName = useDerivedReportNameByReportID(fromReportID); | ||
| const unreportedTransactionMessage = getUnreportedTransactionMessage(translate, action, derivedReportName); |
There was a problem hiding this comment.
Please also update getUnreportedTransactionMessage function to avoid duplication
…ed params - Replace positional args with named object params matching getMovedTransactionMessage pattern - Add optional fromReport param so callers with useOnyx can pass report directly - Use reportID derived from report or fromReportID for URL and unreported check - Update all 5 callers and 3 tests
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 831fe337ba
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
|
@MelvinBot Could you check if this comment has already been resolved? |
|
✅ Yes, this comment has been addressed — in commit 04db63d ( The Codex bot asked to pass
The only thing left is to click Resolve conversation on the thread to reflect that. |
|
@hoangzinh regarding Codex's review, I notice that when fromReportID is CONST.REPORT.UNREPORTED_REPORT_ID, fromReport is undefined -> fromReportID ?? toReportID is different than fromReport ?? toReport New behavior Original behavior Could you check if this is actually an issue? |
If App/src/libs/ReportActionsUtils.ts Lines 1293 to 1295 in c8faa39 I also tested this and confirmed that these reports are not shown in the UI so this is not an issue I suggest keeping the current implementation to keep the code clean. |
|
@codex review |
Reviewer Checklist
Screenshots/VideosScreen.Recording.2026-08-26.at.15.21.37.mov |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bd063e0044
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
|
🚧 marcochavezf 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/marcochavezf in version: 9.4.63-0 🚀
|
No help site changes requiredI reviewed this PR against the help site articles in This is an internal refactor with no user-facing behavior change. It migrates Why no docs are affected
The keyword matches in Since no help site change is required, there is no linked help site PR to review. If you believe a customer-facing behavior did change here and should be documented, let me know and I'll create the docs PR. |
|
@hoangzinh This PR in Test 1 step 4 is failing because of a regression issue #99733
The issue is reproducible in: Web, iOS, Android Bug7244718_1787874338231.Recording__2867.mp4 |
|
Oops @mitarachim, sorry that I didn't say it more clearly. We need to submit the report before moving expenses Test 1 — Moved-transaction system message
Screen.Recording.2026-08-28.at.16.38.41.mov |
|
Validated test 1, Pass in Chrome / v9.4.63-0 and Xiaomi Redmi Note 10 / Android 12, App 9.4.63-0 bandicam.2026-08-28.20-31-33-394.mp4Screenrecorder-2026-08-28-20-41-31-894.mp4 |
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 9.4.63-1 🚀
Bundle Size Analysis (Sentry): |

Explanation of Change
This part covers the two transaction-message getters:
getMovedTransactionMessageandgetUnreportedTransactionMessageinReportUtilsFollow-up PRs:
getChatListItemReportNameandgetReportPreviewMessageForCopy(+ migrateSearchActionHeader), threadderivedReportNamethrough the local-notification chain andTask.getShareDestination(+DynamicNewTaskPage), and replace the remainingdeprecatedGetReportNamecall sites withgetReportName. [Phase 2] Part 4 - Migrate deprecatedGetReportName to getReportName in libs #98047Fixed Issues
$ #66427
PROPOSAL:
Tests
Same as QA
Offline tests
Same as QA
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Test 1 — Moved-transaction system message
moved this expense from <report A name>, and the link opens report A.Test 2 — Unreported-transaction system message (
UnreportedTransactionAction)moved this expense from <report name>message rendersTest 3 — Copy to clipboard (
ContextMenuActions)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
Screen.Recording.2026-08-08.110106.mp4