refactor createDraftTransactionAndNavigateToParticipantSelector function#79580
Conversation
…ion to use allTransactionDrafts from useOnyx
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] |
| introSelected?: OnyxEntry<OnyxTypes.IntroSelected>; | ||
|
|
||
| /** All transaction drafts */ | ||
| allTransactionDrafts?: OnyxCollection<OnyxTypes.Transaction>; |
There was a problem hiding this comment.
| allTransactionDrafts?: OnyxCollection<OnyxTypes.Transaction>; | |
| allTransactionDrafts: OnyxCollection<OnyxTypes.Transaction>; |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 52c51c7bef
ℹ️ 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".
| CONST.IOU.ACTION.SUBMIT, | ||
| action.reportActionID, | ||
| introSelected, | ||
| allTransactionDrafts, |
There was a problem hiding this comment.
Ensure draft collection updates refresh memoized handlers
PureReportActionItem is wrapped in memo with a custom comparator that does not include allTransactionDrafts, yet the newly added onPress handlers now capture and pass that collection into createDraftTransactionAndNavigateToParticipantSelector. If a new draft is created or removed after this item first renders (e.g., another expense draft is opened elsewhere), the component will not re-render and the handler will still pass the stale collection, so removeDraftTransactions can miss newer drafts and leave extra drafts behind. Consider adding allTransactionDrafts to the memo comparator or fetching the latest drafts at call time.
Useful? React with 👍 / 👎.
Reviewer Checklist
Screenshots/VideosScreen.Recording.2026-01-15.at.16.15.05.movAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
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! |
|
No product considerations, removing my review |
|
@dukenv0307 we got conflicts |
|
@danieldoglas 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.5-0 🚀
|
|
This PR failing because of this issue in Offline mode |
|
🚀 Deployed to production by https://github.com/Beamanator in version: 9.3.5-7 🚀
|
|
@dukenv0307 @DylanDylann can you check the comment above? |
|
I don't think it's the regression because we can reproduce it on production |
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
Screen.Recording.2026-01-14.at.21.58.09.mov
iOS: Native
iOS: mWeb Safari
Screen.Recording.2026-01-14.at.21.57.03.mov
MacOS: Chrome / Safari
Screen.Recording.2026-01-14.at.21.52.57.mov