Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ function IOURequestStepConfirmation({
setTransactionReport(activeTransactionID, {reportID: CONST.REPORT.UNREPORTED_REPORT_ID}, true);
navigation.setParams({iouType: CONST.IOU.TYPE.TRACK});
} else {
if (iouType !== CONST.IOU.TYPE.SPLIT && iouType !== CONST.IOU.TYPE.CREATE) {
if (iouType === CONST.IOU.TYPE.SUBMIT || iouType === CONST.IOU.TYPE.TRACK) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Update the backing report when preserving pay/invoice

When a user in the PAY/INVOICE confirmation page opens the To picker and selects a different recipient, this branch now preserves the route type but the handler still only writes participants and never updates transaction.reportID/the route report. The rest of this screen derives report from the old report ID, and sendMoney/sendInvoice pass that stale chat or invoice room to the API, so the UI can show the newly selected participant while the payment/invoice is created in the previous chat/room. Please mirror the participant-step report update when keeping PAY/INVOICE here.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thelullabyy I checked this — it's a false positive for this PR. This PR only changes which iouType is preserved (which confirm page / submit branch is used); it doesn't touch transaction.reportID handling or report resolution at all. Both before and after, the recipient branch calls only setMoneyRequestParticipants, and the destination report is resolved at send time from the selected participant, not from a stale ID.

Two reasons the claim doesn't hold for the realistic flows:

  • PAY: The "To" picker is only interactive when transaction.isFromGlobalCreate is true (MoneyRequestConfirmationList.tsx:252), and PAY is never started from the global FAB (only from a 1:1 chat). So the picker can't be reopened in the pay flow — that half of the concern is unreachable.
  • INVOICE (from FAB): The route reportID is a freshly-generated optimistic ID with no report in Onyx, so resolveReportForMoneyRequest returns undefined and sendInvoice derives the room from the selected participant via the existingInvoiceReport path (useExpenseSubmission.ts:909). Destination correctly follows the new recipient.
One narrow pre-existing edge case (not a blocker)

There is a genuine stale-room path: invoice-from-FAB → first pick a recipient who already has an existing invoice room → then reselect a different recipient on the confirm page. In that case transaction.reportID still points at the first recipient's room, and resolveReportForMoneyRequest returns it because the route report is undefined (IOUUtils.ts:504-507).

However, this is pre-existing and not introduced or exposed by this PR — pre-PR, handleParticipantsAdded also never updated transaction.reportID (it only flipped the iouType to create, which is the different bug this PR fixes). It lives entirely in resolveReportForMoneyRequest + the participants-step report write, none of which this diff touches. Worth a separate follow-up issue, not a reason to hold this PR.

So I'd resolve this comment — the bug it describes isn't caused by this change.

navigation.setParams({iouType: CONST.IOU.TYPE.CREATE});
}
setMoneyRequestParticipants(activeTransactionID, participantsList);
Expand Down
Loading