From 2a030ad5f7965e454c15f48d29a495276cdecc0a Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Tue, 17 Mar 2026 20:43:35 +0700 Subject: [PATCH 1/2] fix: Assignee avatar is inconsistent in task & assignee page --- src/libs/ReportUtils.ts | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 6a63dc83c6e87..bd37aef427ea8 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, @@ -10383,17 +10384,6 @@ function getTaskAssigneeChatOnyxData( ); successData.push( - { - onyxMethod: Onyx.METHOD.MERGE, - key: `${ONYXKEYS.COLLECTION.REPORT}${assigneeChatReportID}`, - value: { - pendingFields: { - createChat: null, - }, - // BE will send a different participant. We clear the optimistic one to avoid duplicated entries - participants: {[assigneeAccountID]: null}, - }, - }, { onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT_METADATA}${assigneeChatReportID}`, @@ -10412,13 +10402,26 @@ 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: { + pendingFields: { + createChat: null, + }, + // BE will send a different participant. We clear the optimistic one to avoid duplicated entries + participants: {[assigneeAccountID]: null}, + }, + }, + ); } failureData.push( From e287f7b99beb33bd58f149832f42c36d22b6f277 Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Tue, 17 Mar 2026 21:24:17 +0700 Subject: [PATCH 2/2] always clear createChat pendingField --- src/libs/ReportUtils.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index bd37aef427ea8..75038c2405e58 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -10384,6 +10384,15 @@ function getTaskAssigneeChatOnyxData( ); successData.push( + { + onyxMethod: Onyx.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.REPORT}${assigneeChatReportID}`, + value: { + pendingFields: { + createChat: null, + }, + }, + }, { onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT_METADATA}${assigneeChatReportID}`, @@ -10414,9 +10423,6 @@ function getTaskAssigneeChatOnyxData( onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT}${assigneeChatReportID}`, value: { - pendingFields: { - createChat: null, - }, // BE will send a different participant. We clear the optimistic one to avoid duplicated entries participants: {[assigneeAccountID]: null}, },