From 513d5d62c244a3afbd98f103caa789ac1b35a9cd Mon Sep 17 00:00:00 2001 From: bartlomiej obudzinski Date: Fri, 10 Apr 2026 08:34:40 +0200 Subject: [PATCH 1/5] refactor: add two-level gate pattern to ReportNotFoundGuard --- src/pages/inbox/ReportNotFoundGuard.tsx | 95 ++++++++++++++++++++++--- 1 file changed, 87 insertions(+), 8 deletions(-) diff --git a/src/pages/inbox/ReportNotFoundGuard.tsx b/src/pages/inbox/ReportNotFoundGuard.tsx index c5ce99b3becf..861a421fb93b 100644 --- a/src/pages/inbox/ReportNotFoundGuard.tsx +++ b/src/pages/inbox/ReportNotFoundGuard.tsx @@ -1,6 +1,7 @@ import {useRoute} from '@react-navigation/native'; import type {ReactNode} from 'react'; import React, {useEffect} from 'react'; +import type {OnyxEntry} from 'react-native-onyx'; import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView'; import useNetwork from '@hooks/useNetwork'; import useOnyx from '@hooks/useOnyx'; @@ -15,23 +16,31 @@ import {getParentReportActionDeletionStatus} from '@libs/TransactionNavigationUt import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import {isLoadingInitialReportActionsSelector} from '@src/selectors/ReportMetaData'; +import type * as OnyxTypes from '@src/types/onyx'; type ReportNotFoundGuardProps = { children: ReactNode; }; +/** + * Two-level gate: the outer guard subscribes to lightweight keys to determine + * whether the report clearly exists. When it does (and the report is not a + * transaction thread), children render directly without the cost of + * parentReportMetadata / useParentReportAction subscriptions. + * + * The inner gate mounts only when the "not found" path is plausible: + * the report is missing, the path is invalid, or the report is a transaction + * thread whose parent action may have been deleted. + */ // eslint-disable-next-line rulesdir/no-negated-variables function ReportNotFoundGuard({children}: ReportNotFoundGuardProps) { - const styles = useThemeStyles(); const route = useRoute(); const routeParams = route.params as {reportID?: string} | undefined; const reportIDFromRoute = getNonEmptyStringOnyxID(routeParams?.reportID); const {isOffline} = useNetwork(); - const {shouldUseNarrowLayout} = useResponsiveLayout(); const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportIDFromRoute}`); - const [parentReportMetadata] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_METADATA}${report?.parentReportID}`); const [userLeavingStatus = false] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_USER_IS_LEAVING_ROOM}${reportIDFromRoute}`); const [isLoadingInitialReportActions = true] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_METADATA}${reportIDFromRoute}`, { selector: isLoadingInitialReportActionsSelector, @@ -40,9 +49,81 @@ function ReportNotFoundGuard({children}: ReportNotFoundGuardProps) { const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); const [deleteTransactionNavigateBackUrl] = useOnyx(ONYXKEYS.NVP_DELETE_TRANSACTION_NAVIGATE_BACK_URL); - const parentReportAction = useParentReportAction(report); const reportID = report?.reportID; const isOptimisticDelete = report?.statusNum === CONST.REPORT.STATUS_NUM.CLOSED; + const isInvalidReportPath = !!routeParams?.reportID && !isValidReportIDFromPath(routeParams.reportID); + const isLoading = isLoadingApp !== false || isLoadingReportData || (!isOffline && !!isLoadingInitialReportActions); + const mayBeTransactionThread = isReportTransactionThread(report); + + // Fast path: skip the expensive inner guard (parentReportMetadata, useParentReportAction) + // when we can determine shouldShowNotFoundPage is definitely false. + // + // shouldShowNotFoundPage is false when: + // - deleteTransactionNavigateBackUrl is set (always suppresses not-found), OR + // - path is valid AND report is not a transaction thread AND (still loading OR report exists) + const reportClearlyExists = !!reportID || isOptimisticDelete || userLeavingStatus; + const canSkipInnerGuard = !!deleteTransactionNavigateBackUrl || (!isInvalidReportPath && !mayBeTransactionThread && (isLoading || reportClearlyExists)); + if (canSkipInnerGuard) { + return children; + } + + return ( + + {children} + + ); +} + +type ReportNotFoundInnerGuardProps = { + report: OnyxEntry; + reportIDFromPath: string | undefined; + reportID: string | undefined; + isOptimisticDelete: boolean; + isInvalidReportPath: boolean; + isLoading: boolean; + isLoadingApp: OnyxEntry; + isLoadingReportData: boolean; + isLoadingInitialReportActions: boolean; + isOffline: boolean; + userLeavingStatus: boolean; + deleteTransactionNavigateBackUrl: OnyxEntry; + children: ReactNode; +}; + +// eslint-disable-next-line rulesdir/no-negated-variables +function ReportNotFoundInnerGuard({ + report, + reportIDFromPath, + reportID, + isOptimisticDelete, + isInvalidReportPath, + isLoading, + isLoadingApp, + isLoadingReportData, + isLoadingInitialReportActions, + isOffline, + userLeavingStatus, + deleteTransactionNavigateBackUrl, + children, +}: ReportNotFoundInnerGuardProps) { + const styles = useThemeStyles(); + const {shouldUseNarrowLayout} = useResponsiveLayout(); + + const [parentReportMetadata] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_METADATA}${report?.parentReportID}`); + const parentReportAction = useParentReportAction(report); const {isParentActionMissingAfterLoad, isParentActionDeleted} = getParentReportActionDeletionStatus({ parentReportID: report?.parentReportID, @@ -53,8 +134,6 @@ function ReportNotFoundGuard({children}: ReportNotFoundGuardProps) { }); const isDeletedTransactionThread = isReportTransactionThread(report) && (isParentActionDeleted || isParentActionMissingAfterLoad); - const isInvalidReportPath = !!routeParams?.reportID && !isValidReportIDFromPath(routeParams.reportID); - const isLoading = isLoadingApp !== false || isLoadingReportData || (!isOffline && !!isLoadingInitialReportActions); const reportExists = !!reportID || (!isDeletedTransactionThread && isOptimisticDelete) || userLeavingStatus; // eslint-disable-next-line rulesdir/no-negated-variables @@ -73,7 +152,7 @@ function ReportNotFoundGuard({children}: ReportNotFoundGuardProps) { reportID, isOptimisticDelete, userLeavingStatus, - reportIDFromPath: routeParams?.reportID, + reportIDFromPath, deleteTransactionNavigateBackUrl, isDeletedTransactionThread, isParentActionDeleted, @@ -88,7 +167,7 @@ function ReportNotFoundGuard({children}: ReportNotFoundGuardProps) { reportID, isOptimisticDelete, userLeavingStatus, - routeParams?.reportID, + reportIDFromPath, deleteTransactionNavigateBackUrl, isDeletedTransactionThread, isParentActionDeleted, From 863629e4529e5302d31f54a5d1fd09dc43842272 Mon Sep 17 00:00:00 2001 From: bartlomiej obudzinski Date: Fri, 10 Apr 2026 08:56:15 +0200 Subject: [PATCH 2/5] refactor: simplify inner guard to self-contained component with 2 props --- src/pages/inbox/ReportNotFoundGuard.tsx | 69 +++++++++---------------- 1 file changed, 23 insertions(+), 46 deletions(-) diff --git a/src/pages/inbox/ReportNotFoundGuard.tsx b/src/pages/inbox/ReportNotFoundGuard.tsx index 861a421fb93b..18043205baef 100644 --- a/src/pages/inbox/ReportNotFoundGuard.tsx +++ b/src/pages/inbox/ReportNotFoundGuard.tsx @@ -1,7 +1,6 @@ import {useRoute} from '@react-navigation/native'; import type {ReactNode} from 'react'; import React, {useEffect} from 'react'; -import type {OnyxEntry} from 'react-native-onyx'; import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView'; import useNetwork from '@hooks/useNetwork'; import useOnyx from '@hooks/useOnyx'; @@ -16,7 +15,6 @@ import {getParentReportActionDeletionStatus} from '@libs/TransactionNavigationUt import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import {isLoadingInitialReportActionsSelector} from '@src/selectors/ReportMetaData'; -import type * as OnyxTypes from '@src/types/onyx'; type ReportNotFoundGuardProps = { children: ReactNode; @@ -67,64 +65,43 @@ function ReportNotFoundGuard({children}: ReportNotFoundGuardProps) { return children; } - return ( - - {children} - - ); + return {children}; } type ReportNotFoundInnerGuardProps = { - report: OnyxEntry; reportIDFromPath: string | undefined; - reportID: string | undefined; - isOptimisticDelete: boolean; - isInvalidReportPath: boolean; - isLoading: boolean; - isLoadingApp: OnyxEntry; - isLoadingReportData: boolean; - isLoadingInitialReportActions: boolean; - isOffline: boolean; - userLeavingStatus: boolean; - deleteTransactionNavigateBackUrl: OnyxEntry; children: ReactNode; }; +/** + * Inner guard that mounts only when the "not found" path is plausible. + * Re-derives all state from its own hooks (Onyx returns cached values + * synchronously, so the extra subscriptions are near-zero cost). + */ // eslint-disable-next-line rulesdir/no-negated-variables -function ReportNotFoundInnerGuard({ - report, - reportIDFromPath, - reportID, - isOptimisticDelete, - isInvalidReportPath, - isLoading, - isLoadingApp, - isLoadingReportData, - isLoadingInitialReportActions, - isOffline, - userLeavingStatus, - deleteTransactionNavigateBackUrl, - children, -}: ReportNotFoundInnerGuardProps) { +function ReportNotFoundInnerGuard({reportIDFromPath, children}: ReportNotFoundInnerGuardProps) { const styles = useThemeStyles(); const {shouldUseNarrowLayout} = useResponsiveLayout(); + const {isOffline} = useNetwork(); + + const reportIDFromRoute = getNonEmptyStringOnyxID(reportIDFromPath); + const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportIDFromRoute}`); + const [userLeavingStatus = false] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_USER_IS_LEAVING_ROOM}${reportIDFromRoute}`); + const [isLoadingInitialReportActions = true] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_METADATA}${reportIDFromRoute}`, { + selector: isLoadingInitialReportActionsSelector, + }); + const [isLoadingReportData = true] = useOnyx(ONYXKEYS.IS_LOADING_REPORT_DATA); + const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); + const [deleteTransactionNavigateBackUrl] = useOnyx(ONYXKEYS.NVP_DELETE_TRANSACTION_NAVIGATE_BACK_URL); const [parentReportMetadata] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_METADATA}${report?.parentReportID}`); const parentReportAction = useParentReportAction(report); + const reportID = report?.reportID; + const isOptimisticDelete = report?.statusNum === CONST.REPORT.STATUS_NUM.CLOSED; + const isInvalidReportPath = !!reportIDFromPath && !isValidReportIDFromPath(reportIDFromPath); + const isLoading = isLoadingApp !== false || isLoadingReportData || (!isOffline && !!isLoadingInitialReportActions); + const {isParentActionMissingAfterLoad, isParentActionDeleted} = getParentReportActionDeletionStatus({ parentReportID: report?.parentReportID, parentReportActionID: report?.parentReportActionID, From 2114698439472cc86088b797fc35285cc7475a92 Mon Sep 17 00:00:00 2001 From: bartlomiej obudzinski Date: Mon, 13 Apr 2026 08:38:04 +0200 Subject: [PATCH 3/5] refactor: outer guard handles not-found directly, inner guard only checks deleted transaction thread --- src/pages/inbox/ReportNotFoundGuard.tsx | 126 ++++++++++++------------ 1 file changed, 64 insertions(+), 62 deletions(-) diff --git a/src/pages/inbox/ReportNotFoundGuard.tsx b/src/pages/inbox/ReportNotFoundGuard.tsx index 18043205baef..2358ab926caa 100644 --- a/src/pages/inbox/ReportNotFoundGuard.tsx +++ b/src/pages/inbox/ReportNotFoundGuard.tsx @@ -21,18 +21,18 @@ type ReportNotFoundGuardProps = { }; /** - * Two-level gate: the outer guard subscribes to lightweight keys to determine - * whether the report clearly exists. When it does (and the report is not a - * transaction thread), children render directly without the cost of - * parentReportMetadata / useParentReportAction subscriptions. + * Two-level gate: the outer guard subscribes to lightweight keys and handles + * all "obvious" not-found cases (invalid path, report missing after load). * - * The inner gate mounts only when the "not found" path is plausible: - * the report is missing, the path is invalid, or the report is a transaction - * thread whose parent action may have been deleted. + * The inner gate mounts only for transaction threads, where the expensive + * parentReportMetadata / useParentReportAction subscriptions are needed to + * detect whether the parent action was deleted. */ // eslint-disable-next-line rulesdir/no-negated-variables function ReportNotFoundGuard({children}: ReportNotFoundGuardProps) { const route = useRoute(); + const styles = useThemeStyles(); + const {shouldUseNarrowLayout} = useResponsiveLayout(); const routeParams = route.params as {reportID?: string} | undefined; const reportIDFromRoute = getNonEmptyStringOnyxID(routeParams?.reportID); @@ -51,21 +51,60 @@ function ReportNotFoundGuard({children}: ReportNotFoundGuardProps) { const isOptimisticDelete = report?.statusNum === CONST.REPORT.STATUS_NUM.CLOSED; const isInvalidReportPath = !!routeParams?.reportID && !isValidReportIDFromPath(routeParams.reportID); const isLoading = isLoadingApp !== false || isLoadingReportData || (!isOffline && !!isLoadingInitialReportActions); - const mayBeTransactionThread = isReportTransactionThread(report); - - // Fast path: skip the expensive inner guard (parentReportMetadata, useParentReportAction) - // when we can determine shouldShowNotFoundPage is definitely false. - // - // shouldShowNotFoundPage is false when: - // - deleteTransactionNavigateBackUrl is set (always suppresses not-found), OR - // - path is valid AND report is not a transaction thread AND (still loading OR report exists) - const reportClearlyExists = !!reportID || isOptimisticDelete || userLeavingStatus; - const canSkipInnerGuard = !!deleteTransactionNavigateBackUrl || (!isInvalidReportPath && !mayBeTransactionThread && (isLoading || reportClearlyExists)); - if (canSkipInnerGuard) { - return children; + const reportExists = !!reportID || isOptimisticDelete || userLeavingStatus; + + // eslint-disable-next-line rulesdir/no-negated-variables + const shouldShowNotFoundPage = !deleteTransactionNavigateBackUrl && (isInvalidReportPath || (!isLoading && !reportExists)); + + useEffect(() => { + if (!shouldShowNotFoundPage) { + return; + } + Log.info('[ReportScreen] Displaying NotFound Page', false, { + isLoadingApp, + isLoadingReportData, + isOffline, + isLoadingInitialReportActions, + reportID, + isOptimisticDelete, + userLeavingStatus, + reportIDFromPath: routeParams?.reportID, + deleteTransactionNavigateBackUrl, + }); + }, [ + shouldShowNotFoundPage, + isLoadingApp, + isLoadingReportData, + isOffline, + isLoadingInitialReportActions, + reportID, + isOptimisticDelete, + userLeavingStatus, + routeParams?.reportID, + deleteTransactionNavigateBackUrl, + ]); + + if (shouldShowNotFoundPage) { + return ( + + {children} + + ); + } + + if (isReportTransactionThread(report)) { + return {children}; } - return {children}; + return children; } type ReportNotFoundInnerGuardProps = { @@ -74,9 +113,8 @@ type ReportNotFoundInnerGuardProps = { }; /** - * Inner guard that mounts only when the "not found" path is plausible. - * Re-derives all state from its own hooks (Onyx returns cached values - * synchronously, so the extra subscriptions are near-zero cost). + * Inner guard for transaction threads only. Subscribes to the expensive + * parentReportMetadata and parentReportAction to detect deleted parent actions. */ // eslint-disable-next-line rulesdir/no-negated-variables function ReportNotFoundInnerGuard({reportIDFromPath, children}: ReportNotFoundInnerGuardProps) { @@ -87,21 +125,10 @@ function ReportNotFoundInnerGuard({reportIDFromPath, children}: ReportNotFoundIn const reportIDFromRoute = getNonEmptyStringOnyxID(reportIDFromPath); const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportIDFromRoute}`); - const [userLeavingStatus = false] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_USER_IS_LEAVING_ROOM}${reportIDFromRoute}`); - const [isLoadingInitialReportActions = true] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_METADATA}${reportIDFromRoute}`, { - selector: isLoadingInitialReportActionsSelector, - }); - const [isLoadingReportData = true] = useOnyx(ONYXKEYS.IS_LOADING_REPORT_DATA); - const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); const [deleteTransactionNavigateBackUrl] = useOnyx(ONYXKEYS.NVP_DELETE_TRANSACTION_NAVIGATE_BACK_URL); const [parentReportMetadata] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_METADATA}${report?.parentReportID}`); const parentReportAction = useParentReportAction(report); - const reportID = report?.reportID; - const isOptimisticDelete = report?.statusNum === CONST.REPORT.STATUS_NUM.CLOSED; - const isInvalidReportPath = !!reportIDFromPath && !isValidReportIDFromPath(reportIDFromPath); - const isLoading = isLoadingApp !== false || isLoadingReportData || (!isOffline && !!isLoadingInitialReportActions); - const {isParentActionMissingAfterLoad, isParentActionDeleted} = getParentReportActionDeletionStatus({ parentReportID: report?.parentReportID, parentReportActionID: report?.parentReportActionID, @@ -111,45 +138,20 @@ function ReportNotFoundInnerGuard({reportIDFromPath, children}: ReportNotFoundIn }); const isDeletedTransactionThread = isReportTransactionThread(report) && (isParentActionDeleted || isParentActionMissingAfterLoad); - const reportExists = !!reportID || (!isDeletedTransactionThread && isOptimisticDelete) || userLeavingStatus; - // eslint-disable-next-line rulesdir/no-negated-variables - const shouldShowNotFoundPage = !deleteTransactionNavigateBackUrl && (isDeletedTransactionThread || isInvalidReportPath || (!isLoading && !reportExists)); + const shouldShowNotFoundPage = !deleteTransactionNavigateBackUrl && isDeletedTransactionThread; useEffect(() => { if (!shouldShowNotFoundPage) { return; } - - Log.info('[ReportScreen] Displaying NotFound Page', false, { - isLoadingApp, - isLoadingReportData, - isOffline, - isLoadingInitialReportActions, - reportID, - isOptimisticDelete, - userLeavingStatus, + Log.info('[ReportScreen] Displaying NotFound Page (deleted transaction thread)', false, { reportIDFromPath, deleteTransactionNavigateBackUrl, - isDeletedTransactionThread, isParentActionDeleted, isParentActionMissingAfterLoad, }); - }, [ - shouldShowNotFoundPage, - isLoadingApp, - isLoadingReportData, - isOffline, - isLoadingInitialReportActions, - reportID, - isOptimisticDelete, - userLeavingStatus, - reportIDFromPath, - deleteTransactionNavigateBackUrl, - isDeletedTransactionThread, - isParentActionDeleted, - isParentActionMissingAfterLoad, - ]); + }, [shouldShowNotFoundPage, reportIDFromPath, deleteTransactionNavigateBackUrl, isParentActionDeleted, isParentActionMissingAfterLoad]); return ( Date: Mon, 13 Apr 2026 11:05:05 +0200 Subject: [PATCH 4/5] refactor: address review feedback, simplify inner guard --- src/pages/inbox/ReportNotFoundGuard.tsx | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/pages/inbox/ReportNotFoundGuard.tsx b/src/pages/inbox/ReportNotFoundGuard.tsx index 2358ab926caa..79d21594092d 100644 --- a/src/pages/inbox/ReportNotFoundGuard.tsx +++ b/src/pages/inbox/ReportNotFoundGuard.tsx @@ -21,12 +21,9 @@ type ReportNotFoundGuardProps = { }; /** - * Two-level gate: the outer guard subscribes to lightweight keys and handles + * The outer guard subscribes to lightweight keys and handles * all "obvious" not-found cases (invalid path, report missing after load). * - * The inner gate mounts only for transaction threads, where the expensive - * parentReportMetadata / useParentReportAction subscriptions are needed to - * detect whether the parent action was deleted. */ // eslint-disable-next-line rulesdir/no-negated-variables function ReportNotFoundGuard({children}: ReportNotFoundGuardProps) { @@ -100,7 +97,7 @@ function ReportNotFoundGuard({children}: ReportNotFoundGuardProps) { ); } - if (isReportTransactionThread(report)) { + if (!deleteTransactionNavigateBackUrl && isReportTransactionThread(report)) { return {children}; } @@ -125,7 +122,6 @@ function ReportNotFoundInnerGuard({reportIDFromPath, children}: ReportNotFoundIn const reportIDFromRoute = getNonEmptyStringOnyxID(reportIDFromPath); const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportIDFromRoute}`); - const [deleteTransactionNavigateBackUrl] = useOnyx(ONYXKEYS.NVP_DELETE_TRANSACTION_NAVIGATE_BACK_URL); const [parentReportMetadata] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_METADATA}${report?.parentReportID}`); const parentReportAction = useParentReportAction(report); @@ -136,10 +132,10 @@ function ReportNotFoundInnerGuard({reportIDFromPath, children}: ReportNotFoundIn parentReportMetadata, isOffline, }); - const isDeletedTransactionThread = isReportTransactionThread(report) && (isParentActionDeleted || isParentActionMissingAfterLoad); + const isDeletedTransactionThread = isParentActionDeleted || isParentActionMissingAfterLoad; // eslint-disable-next-line rulesdir/no-negated-variables - const shouldShowNotFoundPage = !deleteTransactionNavigateBackUrl && isDeletedTransactionThread; + const shouldShowNotFoundPage = isDeletedTransactionThread; useEffect(() => { if (!shouldShowNotFoundPage) { @@ -147,11 +143,10 @@ function ReportNotFoundInnerGuard({reportIDFromPath, children}: ReportNotFoundIn } Log.info('[ReportScreen] Displaying NotFound Page (deleted transaction thread)', false, { reportIDFromPath, - deleteTransactionNavigateBackUrl, isParentActionDeleted, isParentActionMissingAfterLoad, }); - }, [shouldShowNotFoundPage, reportIDFromPath, deleteTransactionNavigateBackUrl, isParentActionDeleted, isParentActionMissingAfterLoad]); + }, [shouldShowNotFoundPage, reportIDFromPath, isParentActionDeleted, isParentActionMissingAfterLoad]); return ( Date: Mon, 13 Apr 2026 11:17:23 +0200 Subject: [PATCH 5/5] refactor: inline isDeletedTransactionThread into shouldShowNotFoundPage --- src/pages/inbox/ReportNotFoundGuard.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/pages/inbox/ReportNotFoundGuard.tsx b/src/pages/inbox/ReportNotFoundGuard.tsx index 79d21594092d..c3a4edd30047 100644 --- a/src/pages/inbox/ReportNotFoundGuard.tsx +++ b/src/pages/inbox/ReportNotFoundGuard.tsx @@ -132,10 +132,8 @@ function ReportNotFoundInnerGuard({reportIDFromPath, children}: ReportNotFoundIn parentReportMetadata, isOffline, }); - const isDeletedTransactionThread = isParentActionDeleted || isParentActionMissingAfterLoad; - // eslint-disable-next-line rulesdir/no-negated-variables - const shouldShowNotFoundPage = isDeletedTransactionThread; + const shouldShowNotFoundPage = isParentActionDeleted || isParentActionMissingAfterLoad; useEffect(() => { if (!shouldShowNotFoundPage) {