Scan - Split details page does not show the new UI when scan expense is split offline - #102799
thelullabyy wants to merge 1 commit into
Conversation
|
@ikevin127 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] |
Reviewer Checklist
Screenshots/VideosScreen.Recording.2026-10-01.at.16.54.25.mov |
| receipt: { | ||
| state: CONST.IOU.RECEIPT_STATE.OPEN, | ||
| }, | ||
| iouRequestType: CONST.IOU.REQUEST_TYPE.MANUAL, |
There was a problem hiding this comment.
src/libs/actions/IOU/Split.ts:951
🟢 Could we add a short comment here explaining why ? It's not obvious from the code alone why completing a split flips the type. Without context, someone could later "clean up" this line and quietly bring back #102491.
Something like:
receipt: {
state: CONST.IOU.RECEIPT_STATE.OPEN,
},
// The user filled the fields in by hand, so the receipt is no longer scanned. Mirror what the server returns
// so the split details page renders the manual layout while offline instead of waiting for the response.
iouRequestType: CONST.IOU.REQUEST_TYPE.MANUAL,| splitTransaction = await getOnyxValue(`${ONYXKEYS.COLLECTION.TRANSACTION}${splitTransactionID}`); | ||
| expect(splitTransaction?.iouRequestType).toBe(CONST.IOU.REQUEST_TYPE.MANUAL); | ||
|
|
||
| mockFetch?.resume?.(); |
There was a problem hiding this comment.
tests/actions/IOUTest/SplitTest.ts:1334
🟢 The fix depends on failureData spreading ...unmodifiedTransaction to put iouRequestType: SCAN back if CompleteSplitBill fails. Right now nothing tests that path.
Can we fail the request here and check that it rolls back ? Then a future change to failureData (for example, narrowing the spread to a few fields) can't leave a failed split stuck in the manual layout with an RBR:
mockFetch?.fail?.();
await mockFetch?.resume?.();
await waitForBatchedUpdates();
// Then the split goes back to being a scan request so the user can retry from the original state
splitTransaction = await getOnyxValue(`${ONYXKEYS.COLLECTION.TRANSACTION}${splitTransactionID}`);
expect(splitTransaction?.iouRequestType).toBe(CONST.IOU.REQUEST_TYPE.SCAN);
expect(splitTransaction?.errors).toBeTruthy();(This also awaits resume() the way the other tests in this file do.)

Explanation of Change
Fixed Issues
$ #102491
PROPOSAL:
Tests
Offline tests
QA Steps
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.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2026-10-02.at.02.34.58.mov