From 6f44174bf441f30c1f417c19e0188bcff92cb3b7 Mon Sep 17 00:00:00 2001 From: Abdelhafidh Belalia <16493223+s77rt@users.noreply.github.com> Date: Wed, 18 Mar 2026 17:25:02 +0100 Subject: [PATCH 1/7] log not found in first occurance --- src/pages/Search/SearchMoneyRequestReportPage.tsx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/pages/Search/SearchMoneyRequestReportPage.tsx b/src/pages/Search/SearchMoneyRequestReportPage.tsx index 690565e2ffb7..cc1cea9009eb 100644 --- a/src/pages/Search/SearchMoneyRequestReportPage.tsx +++ b/src/pages/Search/SearchMoneyRequestReportPage.tsx @@ -374,15 +374,12 @@ function SearchMoneyRequestReportPage({route}: SearchMoneyRequestPageProps) { isThreadReportDeletedForReview, ]); - const prevShouldShowAccessErrorPage = usePrevious(shouldShowAccessErrorPage); - const participantCount = Object.keys(report?.participants ?? {}).length; - useEffect(() => { - if (!shouldShowAccessErrorPage || prevShouldShowAccessErrorPage) { + if (!shouldShowAccessErrorPage) { return; } - Log.info('[SearchMoneyRequestReportPage] shouldShowAccessErrorPage changed to true', false, { + Log.info('[SearchMoneyRequestReportPage] Displaying NotFound Page', false, { reportIDFromRoute, reportID, doesReportIDLookValid, @@ -392,7 +389,7 @@ function SearchMoneyRequestReportPage({route}: SearchMoneyRequestPageProps) { doesOwnerHavePersonalDetails, doesOwnerHaveAvatar, doesOwnerHaveDefaultAvatar, - participantCount, + participantCount: Object.keys(report?.participants ?? {}).length, }); }, [ doesOwnerHaveAvatar, @@ -401,11 +398,10 @@ function SearchMoneyRequestReportPage({route}: SearchMoneyRequestPageProps) { doesReportIDLookValid, isLoadingApp, ownerAccountID, - participantCount, - prevShouldShowAccessErrorPage, reportID, reportIDFromRoute, reportMetadata?.isLoadingInitialReportActions, + report?.participants, shouldShowAccessErrorPage, ]); From 42423bdfefe5ac32b978305cfa0d91bbc15d6f2a Mon Sep 17 00:00:00 2001 From: Abdelhafidh Belalia <16493223+s77rt@users.noreply.github.com> Date: Wed, 18 Mar 2026 17:27:56 +0100 Subject: [PATCH 2/7] update log params to match with not found dependencies --- .../Search/SearchMoneyRequestReportPage.tsx | 34 +++++++++---------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/src/pages/Search/SearchMoneyRequestReportPage.tsx b/src/pages/Search/SearchMoneyRequestReportPage.tsx index cc1cea9009eb..3057e8138cd5 100644 --- a/src/pages/Search/SearchMoneyRequestReportPage.tsx +++ b/src/pages/Search/SearchMoneyRequestReportPage.tsx @@ -380,29 +380,27 @@ function SearchMoneyRequestReportPage({route}: SearchMoneyRequestPageProps) { } Log.info('[SearchMoneyRequestReportPage] Displaying NotFound Page', false, { - reportIDFromRoute, reportID, + hasLoadedReportActionsForAccessError, doesReportIDLookValid, - isLoadingApp, - isLoadingInitialReportActions: reportMetadata?.isLoadingInitialReportActions, - ownerAccountID, - doesOwnerHavePersonalDetails, - doesOwnerHaveAvatar, - doesOwnerHaveDefaultAvatar, - participantCount: Object.keys(report?.participants ?? {}).length, + isReportPendingDeletion, + wereAllTransactionsDeleted, + hasAnyTransactions, + deleteTransactionNavigateBackUrl, + wasParentActionDeleted, + isThreadReportDeletedForReview, }); }, [ - doesOwnerHaveAvatar, - doesOwnerHaveDefaultAvatar, - doesOwnerHavePersonalDetails, - doesReportIDLookValid, - isLoadingApp, - ownerAccountID, - reportID, - reportIDFromRoute, - reportMetadata?.isLoadingInitialReportActions, - report?.participants, shouldShowAccessErrorPage, + reportID, + hasLoadedReportActionsForAccessError, + doesReportIDLookValid, + isReportPendingDeletion, + wereAllTransactionsDeleted, + hasAnyTransactions, + deleteTransactionNavigateBackUrl, + wasParentActionDeleted, + isThreadReportDeletedForReview, ]); return ( From a94422e83654fb46fd305bf1178e5fb78aa1d983 Mon Sep 17 00:00:00 2001 From: Abdelhafidh Belalia <16493223+s77rt@users.noreply.github.com> Date: Wed, 18 Mar 2026 17:30:44 +0100 Subject: [PATCH 3/7] log report not found --- src/pages/inbox/ReportScreen.tsx | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/pages/inbox/ReportScreen.tsx b/src/pages/inbox/ReportScreen.tsx index cce3a62827b1..2a2256a10f37 100644 --- a/src/pages/inbox/ReportScreen.tsx +++ b/src/pages/inbox/ReportScreen.tsx @@ -550,6 +550,41 @@ function ReportScreen({route, navigation}: ReportScreenProps) { isDeletedTransactionThread, ]); + useEffect(() => { + if (!shouldShowNotFoundPage) { + return; + } + + Log.info('[ReportScreen] Displaying NotFound Page', false, { + shouldShowNotFoundLinkedAction, + isLoadingApp, + isLoadingReportData, + isOffline, + isLoadingInitialReportActions: reportMetadata?.isLoadingInitialReportActions, + reportID, + isOptimisticDelete, + userLeavingStatus, + currentReportIDFormRoute, + firstRender, + deleteTransactionNavigateBackUrl, + isDeletedTransactionThread, + }); + }, [ + shouldShowNotFoundPage, + shouldShowNotFoundLinkedAction, + isLoadingApp, + isLoadingReportData, + isOffline, + reportMetadata?.isLoadingInitialReportActions, + reportID, + isOptimisticDelete, + userLeavingStatus, + currentReportIDFormRoute, + firstRender, + deleteTransactionNavigateBackUrl, + isDeletedTransactionThread, + ]); + const createOneTransactionThreadReport = useCallback(() => { const currentReportTransaction = getReportTransactions(reportID).filter((transaction) => transaction.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE); const oneTransactionID = currentReportTransaction.at(0)?.transactionID; From 96636465b2707d3b0cabf0c0e652e25cf1704e4a Mon Sep 17 00:00:00 2001 From: Abdelhafidh Belalia <16493223+s77rt@users.noreply.github.com> Date: Wed, 18 Mar 2026 17:45:26 +0100 Subject: [PATCH 4/7] add more params to log --- src/pages/Search/SearchMoneyRequestReportPage.tsx | 2 ++ src/pages/inbox/ReportScreen.tsx | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/pages/Search/SearchMoneyRequestReportPage.tsx b/src/pages/Search/SearchMoneyRequestReportPage.tsx index 3057e8138cd5..b6357a2a2c5c 100644 --- a/src/pages/Search/SearchMoneyRequestReportPage.tsx +++ b/src/pages/Search/SearchMoneyRequestReportPage.tsx @@ -389,6 +389,7 @@ function SearchMoneyRequestReportPage({route}: SearchMoneyRequestPageProps) { deleteTransactionNavigateBackUrl, wasParentActionDeleted, isThreadReportDeletedForReview, + shouldUseSnapshotTransaction, }); }, [ shouldShowAccessErrorPage, @@ -401,6 +402,7 @@ function SearchMoneyRequestReportPage({route}: SearchMoneyRequestPageProps) { deleteTransactionNavigateBackUrl, wasParentActionDeleted, isThreadReportDeletedForReview, + shouldUseSnapshotTransaction, ]); return ( diff --git a/src/pages/inbox/ReportScreen.tsx b/src/pages/inbox/ReportScreen.tsx index 2a2256a10f37..e2637b74d770 100644 --- a/src/pages/inbox/ReportScreen.tsx +++ b/src/pages/inbox/ReportScreen.tsx @@ -568,6 +568,12 @@ function ReportScreen({route, navigation}: ReportScreenProps) { firstRender, deleteTransactionNavigateBackUrl, isDeletedTransactionThread, + isParentActionDeleted, + isParentActionMissingAfterLoad, + isNavigatingToDeletedAction, + isLinkedActionInaccessibleWhisper, + isLinkedActionDeleted, + isLinkingToMessage, }); }, [ shouldShowNotFoundPage, @@ -583,6 +589,12 @@ function ReportScreen({route, navigation}: ReportScreenProps) { firstRender, deleteTransactionNavigateBackUrl, isDeletedTransactionThread, + isParentActionDeleted, + isParentActionMissingAfterLoad, + isNavigatingToDeletedAction, + isLinkedActionInaccessibleWhisper, + isLinkedActionDeleted, + isLinkingToMessage, ]); const createOneTransactionThreadReport = useCallback(() => { From 19f4259db22e304c54858028b73327bdab73565c Mon Sep 17 00:00:00 2001 From: Abdelhafidh Belalia <16493223+s77rt@users.noreply.github.com> Date: Wed, 18 Mar 2026 17:48:54 +0100 Subject: [PATCH 5/7] lint --- .../Search/SearchMoneyRequestReportPage.tsx | 21 ++----------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/src/pages/Search/SearchMoneyRequestReportPage.tsx b/src/pages/Search/SearchMoneyRequestReportPage.tsx index b6357a2a2c5c..994ce219a43b 100644 --- a/src/pages/Search/SearchMoneyRequestReportPage.tsx +++ b/src/pages/Search/SearchMoneyRequestReportPage.tsx @@ -1,6 +1,6 @@ import {PortalHost} from '@gorhom/portal'; import {useIsFocused} from '@react-navigation/native'; -import React, {useCallback, useEffect, useMemo, useRef} from 'react'; +import React, {useEffect, useMemo, useRef} from 'react'; import {InteractionManager} from 'react-native'; import type {OnyxCollection, OnyxEntry} from 'react-native-onyx'; import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView'; @@ -39,7 +39,6 @@ import { import {isMoneyRequestReport, isMoneyRequestReportPendingDeletion, isValidReportIDFromPath} from '@libs/ReportUtils'; import {cancelSpansByPrefix} from '@libs/telemetry/activeSpans'; import {doesDeleteNavigateBackUrlIncludeDuplicatesReview, getParentReportActionDeletionStatus, hasLoadedReportActions, isThreadReportDeleted} from '@libs/TransactionNavigationUtils'; -import {isDefaultAvatar, isLetterAvatar, isPresetAvatar} from '@libs/UserAvatarUtils'; import Navigation from '@navigation/Navigation'; import ReactionListWrapper from '@pages/inbox/ReactionListWrapper'; import {ActionListContext} from '@pages/inbox/ReportScreenContext'; @@ -47,7 +46,7 @@ import {clearDeleteTransactionNavigateBackUrl, createTransactionThreadReport, op import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import SCREENS from '@src/SCREENS'; -import type {PersonalDetailsList, Policy, Transaction, TransactionViolations} from '@src/types/onyx'; +import type {Policy, Transaction, TransactionViolations} from '@src/types/onyx'; import {getEmptyObject} from '@src/types/utils/EmptyObject'; type SearchMoneyRequestPageProps = @@ -183,22 +182,6 @@ function SearchMoneyRequestReportPage({route}: SearchMoneyRequestPageProps) { parentReportMetadata, isOffline, }); - const ownerAccountID = report?.ownerAccountID; - const ownerPersonalDetailsSelector = useCallback( - (personalDetailsList: OnyxEntry) => { - if (!ownerAccountID) { - return undefined; - } - - return personalDetailsList?.[ownerAccountID]; - }, - [ownerAccountID], - ); - const [ownerPersonalDetails] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {selector: ownerPersonalDetailsSelector}, [ownerAccountID]); - const doesOwnerHavePersonalDetails = !!ownerPersonalDetails; - const doesOwnerHaveAvatar = !!ownerPersonalDetails?.avatar; - const doesOwnerHaveDefaultAvatar = - isDefaultAvatar(ownerPersonalDetails?.avatar) || isPresetAvatar(ownerPersonalDetails?.avatar) || isLetterAvatar(ownerPersonalDetails?.originalFileName); // Prevents creating duplicate transaction threads for legacy transactions const hasCreatedLegacyThreadRef = useRef(false); From 81970e4ea6b838b2ae58fe8c2266548cac7637cc Mon Sep 17 00:00:00 2001 From: Abdelhafidh Belalia <16493223+s77rt@users.noreply.github.com> Date: Wed, 18 Mar 2026 17:54:40 +0100 Subject: [PATCH 6/7] lint --- src/pages/Search/SearchMoneyRequestReportPage.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/Search/SearchMoneyRequestReportPage.tsx b/src/pages/Search/SearchMoneyRequestReportPage.tsx index 994ce219a43b..ce7c6dcc45f4 100644 --- a/src/pages/Search/SearchMoneyRequestReportPage.tsx +++ b/src/pages/Search/SearchMoneyRequestReportPage.tsx @@ -2,7 +2,7 @@ import {PortalHost} from '@gorhom/portal'; import {useIsFocused} from '@react-navigation/native'; import React, {useEffect, useMemo, useRef} from 'react'; import {InteractionManager} from 'react-native'; -import type {OnyxCollection, OnyxEntry} from 'react-native-onyx'; +import type {OnyxCollection} from 'react-native-onyx'; import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView'; import DragAndDropProvider from '@components/DragAndDrop/Provider'; import MoneyRequestReportView from '@components/MoneyRequestReportView/MoneyRequestReportView'; @@ -105,7 +105,7 @@ function SearchMoneyRequestReportPage({route}: SearchMoneyRequestPageProps) { } Navigation.dismissModal(); } - }, [report]); + }, [report, isFocused, prevReport]); useEffect(() => { // Update last visit time when the expense super wide RHP report is focused From 817dbd14d042a972e6f2952e9282d491cc918709 Mon Sep 17 00:00:00 2001 From: Abdelhafidh Belalia <16493223+s77rt@users.noreply.github.com> Date: Wed, 18 Mar 2026 18:01:30 +0100 Subject: [PATCH 7/7] ts --- src/components/Search/SearchLoadingSkeleton.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Search/SearchLoadingSkeleton.tsx b/src/components/Search/SearchLoadingSkeleton.tsx index 4dc4bbf9f2c3..95b769e509d3 100644 --- a/src/components/Search/SearchLoadingSkeleton.tsx +++ b/src/components/Search/SearchLoadingSkeleton.tsx @@ -9,7 +9,7 @@ import CONST from '@src/CONST'; type SearchLoadingSkeletonProps = { containerStyle?: StyleProp; - reasonAttributes?: SkeletonSpanReasonAttributes; + reasonAttributes: SkeletonSpanReasonAttributes; }; function SearchLoadingSkeleton({containerStyle, reasonAttributes}: SearchLoadingSkeletonProps) {