Clear transaction holds when marking a submit-and-close report as done#97052
Clear transaction holds when marking a submit-and-close report as done#97052MelvinBot wants to merge 1 commit into
Conversation
When "Mark as done" submits a submit-and-close report straight to CLOSED, optimistically clear transaction.comment.hold on held transactions so the on-hold status bar no longer lingers, mirroring approveMoneyRequest. Co-authored-by: Eugene Voloshchak <eVoloshchak@users.noreply.github.com>
|
There's no code fix to push here — the only failing check is Every actual CI check is green: Bun tests, all 8 The author checklist is a human attestation (confirming you tested on all platforms, checked for console errors, etc.), so I can't and shouldn't tick those boxes on your behalf. To clear it, complete the checklist in the PR description and the check will re-run green. Note: |
Explanation of Change
When a track-intent user holds a track-distance expense and then taps More → Mark as done on a submit-and-close workspace, the report transitions straight to
CLOSED, but the "expense is on hold" status bar keeps rendering in the report header.The hold signal lives on the transaction via
transaction.comment.hold, and the on-hold banner inuseMoneyReportHeaderStatusBaris derived purely from that field with no report-status gate.submitReport()optimistically set the report toCLOSEDbut never cleared the hold on its held transactions — soisOnHold()stayedtrueand the banner lingered. The siblingapproveMoneyRequestflow already clears holds optimistically; the submit path did not.This change adds an optimistic hold-clear in
submitReport()for the submit-and-close path (when the report goes straight toCLOSED), mirroring the existingapproveMoneyRequestblock, with a matchingfailureDatarestore so a server rejection rolls the hold back.Fixed Issues
$ #91781
PROPOSAL: #91781 (comment)
Tests
Offline tests
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, 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.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.AI Tests (run by MelvinBot)
npm run fmt(oxfmt) on the repo — both changed files formatted cleannpm run lint-changed(eslint) — cleannpm run typecheck-tsgo— passednpm test -- tests/actions/IOUTest/ReportWorkflowTest.ts— 84/84 passed, including a new test: "clears the hold on held transactions when submitting a Submit and Close report"Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari