From 9af3f11cbc6e01dd9504eb8eb601cafea87f549d Mon Sep 17 00:00:00 2001 From: c3024 Date: Thu, 26 Sep 2024 10:49:09 +0530 Subject: [PATCH 1/3] Revert "Merge pull request #48445 from bernhardoj/fix/47735-unread-line-shows-on-a-new-msg" This reverts commit 2d1f8cd1cb072f0b9c9672effa65199727553ab9, reversing changes made to 5db0996d52d9c59a8570538a4601dffbca70395c. --- src/pages/home/report/ReportActionsList.tsx | 2 +- tests/perf-test/ReportActionsList.perf-test.tsx | 14 +++----------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/pages/home/report/ReportActionsList.tsx b/src/pages/home/report/ReportActionsList.tsx index 9ff8762956d7..8f5fc907a962 100644 --- a/src/pages/home/report/ReportActionsList.tsx +++ b/src/pages/home/report/ReportActionsList.tsx @@ -268,7 +268,7 @@ function ReportActionsList({ } const mostRecentReportActionCreated = sortedVisibleReportActions[0]?.created ?? ''; - if (mostRecentReportActionCreated === unreadMarkerTime) { + if (mostRecentReportActionCreated <= unreadMarkerTime) { return; } diff --git a/tests/perf-test/ReportActionsList.perf-test.tsx b/tests/perf-test/ReportActionsList.perf-test.tsx index 8f4c39d5f7a2..94a1050e98ce 100644 --- a/tests/perf-test/ReportActionsList.perf-test.tsx +++ b/tests/perf-test/ReportActionsList.perf-test.tsx @@ -81,14 +81,6 @@ beforeEach(() => { }); function ReportActionsListWrapper() { - const reportActions = ReportTestUtils.getMockedSortedReportActions(500); - const lastVisibleActionCreated = reportActions[0].created; - const report = { - ...LHNTestUtilsModule.getFakeReport(), - lastVisibleActionCreated, - lastReadTime: lastVisibleActionCreated, - }; - return ( @@ -96,8 +88,8 @@ function ReportActionsListWrapper() { {}} @@ -105,7 +97,7 @@ function ReportActionsListWrapper() { loadOlderChats={mockLoadChats} loadNewerChats={mockLoadChats} transactionThreadReport={LHNTestUtilsModule.getFakeReport()} - reportActions={reportActions} + reportActions={ReportTestUtils.getMockedSortedReportActions(500)} /> From 93fea45ba5eeac384e745ffb59c0f18be81dd6bc Mon Sep 17 00:00:00 2001 From: c3024 Date: Thu, 26 Sep 2024 17:20:26 +0530 Subject: [PATCH 2/3] rename deprecated measurePerformance --- tests/perf-test/ReportActionsList.perf-test.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/perf-test/ReportActionsList.perf-test.tsx b/tests/perf-test/ReportActionsList.perf-test.tsx index 94a1050e98ce..4b2a114392c5 100644 --- a/tests/perf-test/ReportActionsList.perf-test.tsx +++ b/tests/perf-test/ReportActionsList.perf-test.tsx @@ -1,7 +1,7 @@ import {fireEvent, screen} from '@testing-library/react-native'; import type {ComponentType} from 'react'; import Onyx from 'react-native-onyx'; -import {measurePerformance} from 'reassure'; +import {measureRenders} from 'reassure'; import type {WithCurrentUserPersonalDetailsProps} from '@components/withCurrentUserPersonalDetails'; import type Navigation from '@libs/Navigation/Navigation'; import ComposeProviders from '@src/components/ComposeProviders'; @@ -115,7 +115,7 @@ test('[ReportActionsList] should render ReportActionsList with 500 reportActions [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtilsModule.fakePersonalDetails, }); - await measurePerformance(, {scenario}); + await measureRenders(, {scenario}); }); test('[ReportActionsList] should render list items', async () => { @@ -130,7 +130,7 @@ test('[ReportActionsList] should render list items', async () => { [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtilsModule.fakePersonalDetails, }); - await measurePerformance(, {scenario}); + await measureRenders(, {scenario}); }); test('[ReportActionsList] should scroll through list of items', async () => { @@ -162,5 +162,5 @@ test('[ReportActionsList] should scroll through list of items', async () => { [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtilsModule.fakePersonalDetails, }); - await measurePerformance(, {scenario}); + await measureRenders(, {scenario}); }); From 4a6d6d2bc3050157b6e295ff48478fc985dc0604 Mon Sep 17 00:00:00 2001 From: c3024 Date: Thu, 26 Sep 2024 17:48:35 +0530 Subject: [PATCH 3/3] Revert "rename deprecated measurePerformance" This reverts commit 93fea45ba5eeac384e745ffb59c0f18be81dd6bc. --- tests/perf-test/ReportActionsList.perf-test.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/perf-test/ReportActionsList.perf-test.tsx b/tests/perf-test/ReportActionsList.perf-test.tsx index 4b2a114392c5..94a1050e98ce 100644 --- a/tests/perf-test/ReportActionsList.perf-test.tsx +++ b/tests/perf-test/ReportActionsList.perf-test.tsx @@ -1,7 +1,7 @@ import {fireEvent, screen} from '@testing-library/react-native'; import type {ComponentType} from 'react'; import Onyx from 'react-native-onyx'; -import {measureRenders} from 'reassure'; +import {measurePerformance} from 'reassure'; import type {WithCurrentUserPersonalDetailsProps} from '@components/withCurrentUserPersonalDetails'; import type Navigation from '@libs/Navigation/Navigation'; import ComposeProviders from '@src/components/ComposeProviders'; @@ -115,7 +115,7 @@ test('[ReportActionsList] should render ReportActionsList with 500 reportActions [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtilsModule.fakePersonalDetails, }); - await measureRenders(, {scenario}); + await measurePerformance(, {scenario}); }); test('[ReportActionsList] should render list items', async () => { @@ -130,7 +130,7 @@ test('[ReportActionsList] should render list items', async () => { [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtilsModule.fakePersonalDetails, }); - await measureRenders(, {scenario}); + await measurePerformance(, {scenario}); }); test('[ReportActionsList] should scroll through list of items', async () => { @@ -162,5 +162,5 @@ test('[ReportActionsList] should scroll through list of items', async () => { [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtilsModule.fakePersonalDetails, }); - await measureRenders(, {scenario}); + await measurePerformance(, {scenario}); });