From 228b7cf593b16b0e1a334262617b609cdcb9282d Mon Sep 17 00:00:00 2001 From: Abdelhafidh Belalia <16493223+s77rt@users.noreply.github.com> Date: Fri, 9 Jan 2026 05:54:41 +0100 Subject: [PATCH 1/3] add failureData for legacy transactions thread --- src/libs/actions/Report.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index dda87e095c339..6b64f0f410f80 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -1128,6 +1128,14 @@ function openReport( chatReportID: transactionParentReportID, }, }); + failureData.push({ + onyxMethod: Onyx.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`, + value: { + parentReportActionID: allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`]?.parentReportActionID ?? null, + chatReportID: allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`]?.chatReportID ?? null, + }, + }); optimisticData.push({ onyxMethod: Onyx.METHOD.MERGE, @@ -1139,6 +1147,13 @@ function openReport( }, }, }); + failureData.push({ + onyxMethod: Onyx.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${transactionParentReportID}`, + value: { + [iouReportActionID]: null, + }, + }); parameters.moneyRequestPreviewReportActionID = iouReportActionID; From 0e7bf37fee66458bffae89182bcb660bc436421c Mon Sep 17 00:00:00 2001 From: Abdelhafidh Belalia <16493223+s77rt@users.noreply.github.com> Date: Fri, 9 Jan 2026 06:49:36 +0100 Subject: [PATCH 2/3] remove optimistic transaction thread if request failed --- src/libs/actions/Report.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index 6b64f0f410f80..cb0485f9ad112 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -1131,10 +1131,7 @@ function openReport( failureData.push({ onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`, - value: { - parentReportActionID: allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`]?.parentReportActionID ?? null, - chatReportID: allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`]?.chatReportID ?? null, - }, + value: null, }); optimisticData.push({ From c80149e0828bf2e613c411b71a6570ce7d524689 Mon Sep 17 00:00:00 2001 From: Abdelhafidh Belalia <16493223+s77rt@users.noreply.github.com> Date: Fri, 9 Jan 2026 07:33:37 +0100 Subject: [PATCH 3/3] use SET to clear report --- src/libs/actions/Report.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index cb0485f9ad112..09bf7e6ff2df4 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -1129,7 +1129,7 @@ function openReport( }, }); failureData.push({ - onyxMethod: Onyx.METHOD.MERGE, + onyxMethod: Onyx.METHOD.SET, key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`, value: null, });