Refactor: make changeMoneyRequestHoldStatus pure function receive iouTransaction#84507
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
…uestHoldStatus-pure-function
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b42db89c13
ℹ️ 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".
This comment was marked as outdated.
This comment was marked as outdated.
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. ℹ️ 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". |
|
@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. |
|
@MelvinBot Could you please review this PR? |
|
The rest looks fine to me |
|
The test failure is not related to this PR. |
I've added more tests. I think that's sufficient now, they should cover the UI cases properly. |
|
The statement is partially correct but incomplete. Here's the code evidence: What IS correct
function isRemoveHoldAction(report, chatReport, reportTransactions) {
// ...
const transactionThreadReportID = getOneTransactionThreadReportID(report, chatReport, reportActions);
if (!transactionThreadReportID) {
return false; // ← confirmed
}
const isHolder = reportTransactions.some((transaction) => isHoldCreator(transaction, transactionThreadReportID));
return isHolder;
}What the statement MISSES
Path 1 — line 471 (left side of OR): Path 2 — line 471 (right side of OR): // line 471-472
if (isRemoveHoldAction(report, chatReport, reportTransactions) || (isPayActionWithAllExpensesHeld && expensesToHold.length)) {
return CONST.REPORT.PRIMARY_ACTIONS.REMOVE_HOLD;
}Path 3 — line 491: // line 491-493
if (expensesToHold.length) {
return CONST.REPORT.PRIMARY_ACTIONS.REMOVE_HOLD;
}Both paths 2 and 3 use Is the
|
|
@MelvinBot Many thanks. You did a great job |
Reviewer Checklist
Screenshots/VideosScreen.Recording.2026-03-12.at.18.30.45.movScreen.Recording.2026-03-12.at.18.29.52.mov |
|
@linhvovan29546 We got conflict |
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #66418 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
…atus-pure-function
|
The test failure is not related to this PR. |
|
cc @tgolen |
|
@linhvovan29546 I don't want to merge this with the failing test. Can you see if it's fixed in |
…uestHoldStatus-pure-function
|
@tgolen all tests passed👍 |
|
🚧 @tgolen 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/tgolen in version: 9.3.38-0 🚀
|
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.3.38-4 🚀
|
Explanation of Change
This PR refactors
changeMoneyRequestHoldStatusinReportUtils.tsto be a pure function by receiving theiouTransactionas an explicit parameter instead of looking it up internally from the module-levelallTransactionsOnyx cache. And also rename module-level variables —allTransactions→deprecatedAllTransactionsandreportsTransactions→deprecatedReportsTransactionsFixed Issues
$ #66418
PROPOSAL: N/A
Tests
Test 1:
Test 2:
Test 3:
Offline tests
Same as tests above
QA Steps
Same as tests above
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, 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.ScrollViewcomponent to make it scrollable when more elements are added to the page.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-03-10.at.21.09.57.mov
Android: mWeb Chrome
Screen.Recording.2026-03-10.at.21.05.02.mov
iOS: Native
Screen.Recording.2026-03-10.at.21.01.10.mov
iOS: mWeb Safari
Screen.Recording.2026-03-10.at.20.57.39.mov
MacOS: Chrome / Safari
Screen.Recording.2026-03-10.at.20.50.07.mov