diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 6a63dc83c6e87..75038c2405e58 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -7867,6 +7867,7 @@ function buildOptimisticChatReport({ reportParticipants[accountID] = participant; return reportParticipants; }, {} as Participants); + const currentTime = DateUtils.getDBTime(); const optimisticChatReport: OptimisticChatReport = { type: CONST.REPORT.TYPE.CHAT, @@ -10390,8 +10391,6 @@ function getTaskAssigneeChatOnyxData( pendingFields: { createChat: null, }, - // BE will send a different participant. We clear the optimistic one to avoid duplicated entries - participants: {[assigneeAccountID]: null}, }, }, { @@ -10412,13 +10411,23 @@ function getTaskAssigneeChatOnyxData( // If assignee is created optimistically, we need to clear the optimistic personal details to prevent duplication with real data sent from BE. if (isOptimisticPersonalDetail(assigneeAccountID)) { - successData.push({ - onyxMethod: Onyx.METHOD.MERGE, - key: ONYXKEYS.PERSONAL_DETAILS_LIST, - value: { - [assigneeAccountID]: null, + successData.push( + { + onyxMethod: Onyx.METHOD.MERGE, + key: ONYXKEYS.PERSONAL_DETAILS_LIST, + value: { + [assigneeAccountID]: null, + }, }, - }); + { + onyxMethod: Onyx.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.REPORT}${assigneeChatReportID}`, + value: { + // BE will send a different participant. We clear the optimistic one to avoid duplicated entries + participants: {[assigneeAccountID]: null}, + }, + }, + ); } failureData.push(