Repository navigation
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
participantsand never updatestransaction.reportID/the route report. The rest of this screen derivesreportfrom the old report ID, andsendMoney/sendInvoicepass 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 👍 / 👎.
There was a problem hiding this comment.
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
iouTypeis preserved (which confirm page / submit branch is used); it doesn't touchtransaction.reportIDhandling or report resolution at all. Both before and after, the recipient branch calls onlysetMoneyRequestParticipants, 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:
transaction.isFromGlobalCreateis 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.reportIDis a freshly-generated optimistic ID with no report in Onyx, soresolveReportForMoneyRequestreturnsundefinedandsendInvoicederives the room from the selected participant via theexistingInvoiceReportpath (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.reportIDstill points at the first recipient's room, andresolveReportForMoneyRequestreturns 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,
handleParticipantsAddedalso never updatedtransaction.reportID(it only flipped the iouType tocreate, which is the different bug this PR fixes). It lives entirely inresolveReportForMoneyRequest+ 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.