fix: Created expense at submitted report then create expense at ws chat add to the submitted report#93783
fix: Created expense at submitted report then create expense at ws chat add to the submitted report#93783nkdengineer wants to merge 1 commit into
Conversation
…at add to the submitted report
|
@sobitneupane 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: 93c3bda249
ℹ️ 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".
| // do not update iouReportID if auto submit beta is enabled and it is a scan request | ||
| ...(isASAPSubmitBetaEnabled && isScanRequest ? {} : {iouReportID: iou.report.reportID}), | ||
| // do not update iouReportID if auto submit beta is enabled and it is a scan request, or when adding to an existing report | ||
| ...((isASAPSubmitBetaEnabled && isScanRequest) || !shouldCreateNewMoneyRequestReport ? {} : {iouReportID: iou.report.reportID}), |
There was a problem hiding this comment.
Preserve the new report ID for batched expenses
When the confirmation flow creates multiple expenses, useExpenseSubmission reuses the original report object for every item while passing the first optimistic iouReport as existingIOUReport on later iterations. If that original workspace chat still has a stale iouReportID for a submitted/non-addable report, the first item creates a fresh report and sets the chat to it, but the second item has shouldCreateNewMoneyRequestReport === false; this branch then skips overriding iouReportID and the spread chat.report writes the stale ID back. In that batched scenario, future expenses from the workspace chat can again resolve to the submitted report instead of the new open report.
Useful? React with 👍 / 👎.
Explanation of Change
Fixed Issues
$ #93107
PROPOSAL: #93107 (comment)
Tests
Offline tests
Same
QA Steps
Same as test
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-06-17.at.16.28.40.mp4
Android: mWeb Chrome
Screen.Recording.2026-06-17.at.16.26.32.mov
iOS: Native
Screen.Recording.2026-06-17.at.16.31.52.mp4
iOS: mWeb Safari
Screen.Recording.2026-06-17.at.16.29.45.mov
MacOS: Chrome / Safari
Screen.Recording.2026-06-17.at.16.25.55.mov