From 963eb94eb965a360f149349ef27f5ce9746005e7 Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Wed, 4 Jun 2025 17:38:45 +0700 Subject: [PATCH] Report-Report is not shown in WS chat online after trying to move it to deleted WS offline --- src/libs/actions/Report.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index 51f801225155..081681f516c4 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -5427,7 +5427,7 @@ function changeReportPolicy(reportID: string, policyID: string) { if (reportToMove?.parentReportID && reportToMove?.parentReportActionID) { const workspaceChatReportID = reportToMove.parentReportID; const reportPreviewActionID = reportToMove.parentReportActionID; - const oldReportPreviewAction = allReportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${workspaceChatReportID}`]?.[reportPreviewActionID]; + const oldReportPreviewAction = allReportActions?.[workspaceChatReportID]?.[reportPreviewActionID]; const deletedTime = DateUtils.getDBTime(); const firstMessage = Array.isArray(oldReportPreviewAction?.message) ? oldReportPreviewAction.message.at(0) : null; const updatedReportPreviewAction = { @@ -5459,7 +5459,14 @@ function changeReportPolicy(reportID: string, policyID: string) { failureData.push({ onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${workspaceChatReportID}`, - value: {[reportPreviewActionID]: oldReportPreviewAction}, + value: { + [reportPreviewActionID]: { + ...oldReportPreviewAction, + originalMessage: { + deleted: null, + }, + }, + }, }); // Update the expense chat report