refactor initMoneyRequest - #79960
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] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ae0a397368
ℹ️ 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".
| currentDate, | ||
| currentUserPersonalDetails, | ||
| hasOnlyPersonalPolicies, | ||
| draftTransactions, | ||
| }); | ||
| }, [reportOrAccountID, policy, personalPolicy, report, parentReport, currentDate, currentUserPersonalDetails, hasOnlyPersonalPolicies]); | ||
| }, [reportOrAccountID, policy, personalPolicy, report, parentReport, currentDate, currentUserPersonalDetails, hasOnlyPersonalPolicies, draftTransactions]); |
There was a problem hiding this comment.
Avoid re-running initMoneyRequest on draft changes
Including draftTransactions in this effect’s dependency array means the effect re-runs on every draft update. On this page, users can edit fields like date/currency, which updates the optimistic draft and triggers this effect; initMoneyRequest then merges created/currency back to the defaults when request types match, so those user edits are immediately overwritten. This makes changing the date or currency on the Submit Details flow unreliable. Consider removing draftTransactions from the dependency list or guarding against re-init after the optimistic draft has been edited.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Yes, we can remove it from deps
|
The rest looks fine to me |
Reviewer Checklist
Screenshots/VideosScreen.Recording.2026-01-27.at.16.06.53.mov |
|
Also please add test step |
|
@DylanDylann Done! |
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #67778 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
|
conflicts, please check them and I'll review tomorrow |
|
@danieldoglas I resolved the conflicts. All yours! |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/danieldoglas in version: 9.3.11-0 🚀
|
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.3.12-1 🚀
|
Explanation of Change
Fixed Issues
$ #67778
PROPOSAL:
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand 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
Android: mWeb Chrome
iOS: Native
Screen.Recording.2026-01-23.at.18.08.31.mov
iOS: mWeb Safari
MacOS: Chrome / Safari