From 12f48e10014ff3db5c3ec9732a42038b97305748 Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Tue, 24 Jun 2025 11:23:04 +0700 Subject: [PATCH 1/2] Workspace avatar briefly displayed with every new report added to chat --- src/libs/actions/Report.ts | 1 + tests/actions/ReportTest.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index 1d432ad405ae..187ca47a83dc 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -2705,6 +2705,7 @@ function buildNewReportOptimisticData(policy: OnyxEntry, reportID: strin linkedReportID: reportID, }, pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD, + actorAccountID: accountID, }; const optimisticNextStep = buildNextStep(optimisticReportData, CONST.REPORT.STATUS_NUM.OPEN); diff --git a/tests/actions/ReportTest.ts b/tests/actions/ReportTest.ts index 74e7e5d87cd7..ecde906ed1fa 100644 --- a/tests/actions/ReportTest.ts +++ b/tests/actions/ReportTest.ts @@ -1544,7 +1544,8 @@ describe('actions/Report', () => { }); }); expect(getOriginalMessage(reportPreviewAction)?.linkedReportID).toBe(reportID); - + expect(reportPreviewAction?.accountID).toBe(accountID); + await new Promise((resolve) => { const connection = Onyx.connect({ key: ONYXKEYS.COLLECTION.REPORT, From 05e38eee572be6a0af88540306d62d43641fb24b Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Tue, 24 Jun 2025 14:57:50 +0700 Subject: [PATCH 2/2] update test --- tests/actions/ReportTest.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/actions/ReportTest.ts b/tests/actions/ReportTest.ts index ecde906ed1fa..77135cca3a3c 100644 --- a/tests/actions/ReportTest.ts +++ b/tests/actions/ReportTest.ts @@ -1544,8 +1544,8 @@ describe('actions/Report', () => { }); }); expect(getOriginalMessage(reportPreviewAction)?.linkedReportID).toBe(reportID); - expect(reportPreviewAction?.accountID).toBe(accountID); - + expect(reportPreviewAction?.actorAccountID).toBe(accountID); + await new Promise((resolve) => { const connection = Onyx.connect({ key: ONYXKEYS.COLLECTION.REPORT,