Summary
A report that is not in the user's sidebar (LHN) can incorrectly show the "Hmm... it's not here" (NOT FOUND) page when opened via a direct URL/deep link in New Expensify — even though the report is fully accessible and the backend returns a valid OpenReport response.
This was diagnosed from a customer report where a specific expense report loaded fine in Expensify Classic but showed "not here" in New Expensify. Chrome DevTools confirmed that no OpenReport API call is made at all — the client decides "not found" purely from Onyx state, with no server request.
Root cause
A race condition introduced when ReportScreen.tsx was decomposed into ReportNotFoundGuard + ReportFetchHandler as separate components. The guard evaluates !isLoading && !reportExists in a render cycle before ReportFetchHandler's useEffect fires openReport. For reports not in the sidebar (loaded via direct URL), this produces a false "not here" page.
The original monolithic ReportScreen had the not-found check and the fetch trigger co-located, which provided implicit ordering guarantees (fetch fired before the guard evaluated). The decomposition broke that coupling.
Problematic flow
- User navigates to a report not in their sidebar (via deep link/URL)
OpenApp/ReconnectApp completes → IS_LOADING_REPORT_DATA = false
- Report isn't in the
OpenApp response (not a sidebar report) → reportExists = false
ReportNotFoundGuard sees !isLoading && !reportExists → shows NOT FOUND
ReportFetchHandler's useEffect either hasn't fired yet, or hits an early return
Key code locations
Impact
Not specific to a single user or report. Any report not in the user's sidebar that is accessed via a direct URL can hit this race. This includes deep links, bookmarks, and shared report links.
Repro
- Find a report that is not in the LHN/sidebar (e.g. a submitted/archived expense report on a workspace where you're an admin but the report doesn't surface in the sidebar)
- Navigate to it via direct URL in New Expensify (web)
- Observe the "Hmm... it's not here" page despite having access. The same report loads fine in Expensify Classic.
Note: opening DevTools before navigating and filtering Network by api.php shows that no OpenReport call is fired.
Platform
Web (Chrome). Likely affects all platforms since the logic is shared client-side code.
Issue Owner
Current Issue Owner: @dukenv0307
Summary
A report that is not in the user's sidebar (LHN) can incorrectly show the "Hmm... it's not here" (NOT FOUND) page when opened via a direct URL/deep link in New Expensify — even though the report is fully accessible and the backend returns a valid
OpenReportresponse.This was diagnosed from a customer report where a specific expense report loaded fine in Expensify Classic but showed "not here" in New Expensify. Chrome DevTools confirmed that no
OpenReportAPI call is made at all — the client decides "not found" purely from Onyx state, with no server request.Root cause
A race condition introduced when
ReportScreen.tsxwas decomposed intoReportNotFoundGuard+ReportFetchHandleras separate components. The guard evaluates!isLoading && !reportExistsin a render cycle beforeReportFetchHandler'suseEffectfiresopenReport. For reports not in the sidebar (loaded via direct URL), this produces a false "not here" page.The original monolithic
ReportScreenhad the not-found check and the fetch trigger co-located, which provided implicit ordering guarantees (fetch fired before the guard evaluated). The decomposition broke that coupling.Problematic flow
OpenApp/ReconnectAppcompletes →IS_LOADING_REPORT_DATA=falseOpenAppresponse (not a sidebar report) →reportExists=falseReportNotFoundGuardsees!isLoading && !reportExists→ shows NOT FOUNDReportFetchHandler'suseEffecteither hasn't fired yet, or hits an early returnKey code locations
ReportNotFoundGuard.tsx:54— theshouldShowNotFoundPage = !isLoading && !reportExistsdecisionReportNotFoundGuard.tsx:47-53—isLoadingcombinesIS_LOADING_APP,IS_LOADING_REPORT_DATA, andisLoadingInitialReportActions(the last is RAM-only and defaults totruewhen undefined)ReportFetchHandler.tsx:111-135— the fetch trigger with three early-return conditions that can skip callingopenReportImpact
Not specific to a single user or report. Any report not in the user's sidebar that is accessed via a direct URL can hit this race. This includes deep links, bookmarks, and shared report links.
Repro
Note: opening DevTools before navigating and filtering Network by
api.phpshows that noOpenReportcall is fired.Platform
Web (Chrome). Likely affects all platforms since the logic is shared client-side code.
Issue Owner
Current Issue Owner: @dukenv0307