You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[$250] Clicking "View Details" on an expense/report shows the "Hmm... it's not here" page #89724
Clicking View Details from the expense/report actions menu renders the "Hmm... it's not here" (Not Found) page instead of opening the expected details page.
Steps to Reproduce
Open a report or expense in New Expensify (web).
Open the expense/report actions menu.
Select View Details.
Expected Result
The relevant details page/panel for the selected expense or report should open, allowing the user to view the information normally.
Actual Result
The "Hmm... it's not here" page is rendered, preventing the user from viewing the details.
changed the title [-]Clicking "View Details" on an expense/report shows the "Hmm... it's not here" page[/-][+][$250] Clicking "View Details" on an expense/report shows the "Hmm... it's not here" page[/+]on May 6, 2026
Please re-state the problem that we are trying to solve in this issue.
Clicking View Details from an expense/report actions menu opens a Not Found page instead of the valid details view.
What is the root cause of that problem?
The same action key is used for report-level and transaction-level View Details: src/CONST/index.ts#L1332 and src/CONST/index.ts#L1386. The handlers currently call navigateToDetailsPage() with the money request / expense report object in both flows. That helper builds a report-details route, but expense reports do not have the normal chat/report details page, so navigation lands on the “Hmm... it’s not here” screen.
This affects both code paths that expose the menu: the report header View Details implementation and the transaction/expense header View Details implementation.
What changes do you think we should make in order to solve the problem?
Keep the fix at the menu handler level: when View Details is selected for a money request / expense report, navigate using the parent chat report that owns the details panel, not the money request report itself. For the single-transaction expense menu, use the same rule so both entry points are covered.
This is the narrowest fix: it preserves the existing VIEW_DETAILS actions from src/CONST/index.ts#L1332 / src/CONST/index.ts#L1386, reuses navigateToDetailsPage(), and only corrects which report object is passed from the two visible menu entry points.
Please re-state the problem that we are trying to solve in this issue.
When a user deletes an expense or transaction from the details page on web, the app navigates to the target report but briefly renders the "Hmm... it's not here" (NotFoundPage) before the correct details page appears. This race condition occurs because the URL guard that suppresses the NotFoundPage is being cleared at the wrong time—on the source screen as it loses focus—rather than on the destination screen after it gains focus, causing the guard to become null before the destination screen's data stabilizes.
What is the root cause of that problem?
The bug originates in src/pages/inbox/DeleteTransactionNavigateBackHandler.tsx at lines 19–20. A regression from PR #83613 inverted the isFocused guard from !isFocused to isFocused, inverting the intended behavior.
The causal chain: When deleting a transaction, the source ReportScreen calls clearDeleteTransactionNavigateBackUrl() wrapped in InteractionManager.runAfterInteractions(). With the inverted guard (isFocused), this clear now fires when the source screen loses focus (navigating away). Meanwhile, the destination ReportDetailsPage defers its deleteTransaction() call with another InteractionManager.runAfterInteractions() (line 1064). The destination's ReportNotFoundGuard (line 53 of ReportNotFoundGuard.tsx) uses !deleteTransactionNavigateBackUrl as its suppression guard:
If the source's clear races ahead before the destination's Onyx writes propagate, the URL becomes null, the report thread no longer exists (deleted), and shouldShowNotFoundPage becomes true, briefly rendering the NotFoundPage.
The working analog is ReportNotFoundGuard.tsx (lines 53–64), which expects the URL to remain non-null as a suppression guard until the destination screen stabilizes.
What changes do you think we should make in order to solve the problem?
File:src/pages/inbox/DeleteTransactionNavigateBackHandler.tsx Function:DeleteTransactionNavigateBackHandler Edit: Revert the isFocused guard at line 20 from if (isFocused || ...) back to if (!isFocused || ...). This restores the pre-regression behavior where clearDeleteTransactionNavigateBackUrl() fires only after the destination screen gains focus, ensuring the ReportNotFoundGuard suppression remains non-null until Onyx writes stabilize.
Blast radius: Isolated to DeleteTransactionNavigateBackHandler—a single-character guard inversion with no shared helpers modified. The component is mounted only inside ReportScreen, with no callers passing props into the guard logic.
What alternative solutions did you explore? (Optional)
Moving clearDeleteTransactionNavigateBackUrl() into the deleteTransaction() callback in ReportDetailsPage.tsx (lines 1060–1067) was rejected because it couples clearing to a single call-site and silently breaks any other code path that sets the NVP without going through ReportDetailsPage's navigateToTargetUrl. It also removes the architectural purpose of DeleteTransactionNavigateBackHandler as the canonical clear-on-focus owner.
I traced this back to the recent migration in aaed2e394c1 ("Migrate all reportMetadata readers to reportLoadingState/reportLastVisitTimes") which changed src/pages/inbox/report/withReportOrNotFound.tsx#L78-L87 to read isLoadingInitialReportActions from RAM_ONLY_REPORT_LOADING_STATE (the new RAM-only key) instead of REPORT_METADATA (a persisted key).
Because RAM_ONLY_REPORT_LOADING_STATE is registered as RAM-only in src/setup/index.ts#L60-L73 and the report we are already viewing has isLoadingInitialReportActions: false in it (set by the prior openReport success in src/libs/actions/Report/index.ts#L1399-L1407), the first render of the new screen sees:
// For previously loaded reports, stale metadata may already have isLoadingInitialReportActions: false
LinkedActionNotFoundGuard defends against it with hasSeenLoadingCycle; withReportOrNotFound does not, which is why View Details now renders NotFoundPage on web after the migration.
What changes do you think we should make in order to solve the problem?
I'd suppress NotFoundPage until we've actually observed at least one mount tick where the report subscription has settled — i.e., don't conclude "not found" while report is still undefined from useOnyx. The cleanest way is to require BOTH isLoadingReportData === false AND a settled report value (not just truthiness of the report object):
-const isReportLoaded = !isEmptyObject(report) && !!report?.reportID;+const isReportSettled = report !== undefined; // useOnyx returns undefined until first read resolves+const isReportLoaded = !isEmptyObject(report) && !!report?.reportID;
const isReportArchived = useReportIsArchived(report?.reportID);
// The `isLoadingInitialReportActions` value will become `false` only after the first OpenReport API call is finished (either succeeded or failed)
const shouldFetchReport = isReportIdInRoute && reportLoadingState?.isLoadingInitialReportActions !== false;
This preserves the legitimate "report truly missing" path: once report has been read (even if it's an empty object), isReportSettled is true and shouldShowNotFoundPage evaluates as before. It only blocks the false-positive flash where the RAM-only loading flag has resolved synchronously while the persisted report collection key hasn't yet — exactly the new condition the migration introduced.
What alternative solutions did you explore? (Optional)
Mirroring LinkedActionNotFoundGuard's hasSeenLoadingCycle (require we've seen isLoadingInitialReportActions === true at least once before trusting false). This works but adds state and only helps reports that we re-openReport; reports we already loaded earlier this session never re-enter the loading cycle, so the stale-false race still slips through on the very first tick.
Forcing openReport unconditionally on mount inside withReportOrNotFound. Rejected — re-fetches on every details navigation are wasteful and would mask the underlying timing issue rather than fix it.
Reverting withReportOrNotFound to read reportMetadata?.isLoadingInitialReportActions. Rejected — that key is no longer being written after e34ca74f0dd, so the condition would always evaluate to true and we'd refetch every time.
Please re-state the problem that we are trying to solve in this issue.
On web (NewDot), clicking View Details from the expense or report actions menu renders the "Hmm... it's not here" not-found page instead of opening the expected report details panel. This happens when the user is viewing an expense or report through the wide RHP (the e/:reportID or search/money-request-report routes that mount as super-wide right-panel views).
When the user is inside EXPENSE_REPORT or SEARCH_MONEY_REQUEST_REPORT (the super-wide RHP screens registered at linkingConfig/config.ts:2139), Navigation.navigate calls linkTo, which calls getMinimalAction. That function drills into the current state by matching navigator names top-down. It matches RIGHT_MODAL_NAVIGATOR and descends into the super-wide RHP's inner state — which contains only EXPENSE_REPORT (a single screen at e/:reportID). The resulting minimal action targets that inner state key with payload.name = REPORT_DETAILS. However, EXPENSE_REPORT is a leaf screen — it has no REPORT_DETAILS child. The standard StackRouter cannot resolve this action, so the push silently fails or produces an unroutable path that hits the SCREENS.NOT_FOUND: '*' wildcard route, rendering the not-found page.
The condition isNavigatingToModalFromModal in RootStackRouter.ts:124 — which would correctly handle modal-to-modal transitions — is never reached because getMinimalAction strips the RIGHT_MODAL_NAVIGATOR wrapper from the action before the router sees it.
What changes do you think we should make in order to solve the problem?
In navigateToDetailsPage in src/libs/ReportUtils.ts, check Navigation.getReportRHPActiveRoute() before navigating. That function returns a non-empty string only when the user is inside a super-wide RHP (EXPENSE_REPORT or SEARCH_MONEY_REQUEST_REPORT). When that condition is true, use Navigation.dismissModal({afterTransition: () => Navigation.navigate(...)}) instead of a direct navigate. This pattern — already used widely for modal-then-navigate flows in WorkspaceInviteMessageComponent.tsx and elsewhere — ensures the super-wide RHP is fully dismissed before linkTo runs, so getMinimalAction operates on a navigation state that no longer has a locked-in RHP inner key, and REPORT_DETAILS can be pushed onto a fresh RIGHT_MODAL_NAVIGATOR stack without being swallowed. When not in a super-wide RHP, the existing direct navigate path is preserved.
What alternative solutions did you explore? (Optional)
Option: Change isNavigatingToModalFromModal in RootStackRouter.ts to detect super-wide RHP screens (EXPENSE_REPORT, SEARCH_MONEY_REQUEST_REPORT) and route them through handleNavigatingToModalFromModal. Rejected because that handler replaces the current modal rather than stacking a new one, which would close the expense view before the details panel appears — losing the user's place. It also widens the scope of a navigation primitive that has historically caused state corruption when applied too broadly.
Option: Modify getMinimalAction to detect when the inner target state has no matching screen and fall back to targeting the root state. Rejected because getMinimalAction is a low-level helper used across all navigation flows; changes there risk unintended regressions in other RHP and split-navigator transitions.
Option: Pass a new forceRootNavigator flag to Navigation.navigate to skip getMinimalAction entirely for this call. Rejected because the fix would need threading through multiple layers (navigate → linkTo → getMinimalAction) and adds API surface for a problem that is more cleanly solved at the call site.
The HOC shows NotFoundPage when canAccessReport returns false (line 103). canAccessReport rejects reports that have errorFields.notFound set.
The problem is an inconsistency between guards: the report screens that show the report (SearchMoneyRequestReportPage at line 300-331 and ReportNotFoundGuard) do not check errorFields.notFound, while withReportOrNotFound does. So a report with a stale notFound error is visible in the report view, but clicking "View Details" shows the Not Found page.
Compounding this, withReportOrNotFound's openReport effect (line 91-99) skips calling openReport when isReportLoaded is true. Since the report data exists in Onyx (the user was just viewing it), the stale errorFields.notFound is never cleared by a fresh openReport success response.
What changes do you think we should make in order to solve the problem?
Two complementary fixes:
In withReportOrNotFound: When isReportLoaded is true but canAccessReport fails due to errorFields.notFound, call openReport to refresh the report data instead of immediately showing NotFoundPage. This gives the server a chance to clear the stale error.
In canAccessReport or withReportOrNotFound: Consider clearing errorFields.notFound from the report when the report has valid data (has a reportID, is not empty). If the report data exists in Onyx with real content, a stale notFound error from a prior failed API call should not permanently block access to details.
The fix in option 1 is more conservative — it retries the API call before giving up. The fix in option 2 directly addresses the stale state.
What alternative solutions did you explore? (Optional)
Aligning SearchMoneyRequestReportPage and ReportNotFoundGuard to also check errorFields.notFound was considered, but this would make the report inaccessible everywhere rather than fixing the inconsistency.
Modifying the openReport failure data to explicitly clear errorFields.notFound was considered, but the failure data shouldn't make assumptions about prior state.
Investigation details
Navigation flow:
User sees report → clicks three-dot menu → "View Details"
But withReportOrNotFound skips openReport when report is already loaded (line 92)
So the stale notFound error is never cleared
Recent migration (commit aaed2e394c1):
Changed shouldFetchReport from using persisted reportMetadata to RAM-only reportLoadingState
When reportLoadingState is undefined (RAM cleared), shouldFetchReport becomes true
This actually helps: it would trigger a loading indicator and openReport call if the report weren't loaded
However, since the report IS loaded (just has stale notFound), this doesn't help
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.
Clicking View details from the secondary-action ("More") menu on an expense/report navigates to a route the destination cannot resolve, so withReportOrNotFound falls through to the "Hmm... it's not here" page.
Root cause
navigateToDetailsPage in src/libs/ReportUtils.ts:6180-6193 is the single point that builds the destination URL for both menu entry points. After ruling out self-DMs and one-on-one chats, it pushes whatever report.reportID it was handed, with no validation:
These are used as transaction grouping buckets, not real reports — they never have a corresponding ${ONYXKEYS.COLLECTION.REPORT}{id} entry. When a user opens an unreported expense (transaction whose reportID === '0'), the transaction-thread context resolves report.reportID to that placeholder. The transaction-level handler in src/components/MoneyRequestHeaderSecondaryActions.tsx:395-402 then passes the placeholder straight in:
Navigation.navigate lands on r/0/details (or r/-1/details, r/-2/details). withReportOrNotFound (src/pages/inbox/report/withReportOrNotFound.tsx:101-122) computes isReportLoaded = !isEmptyObject(report) && !!report?.reportID, sees no record, fires openReport({reportID: '0'}), and once reportLoadingState.isLoadingInitialReportActions flips to false, shouldShowNotFoundPage becomes true → "Hmm... it's not here."
2 - VIEW_DETAILS is pushed unconditionally even when the underlying report can't render details.src/libs/ReportSecondaryActionUtils.ts:1015 and :1098 both append the action with no guard:
So the menu item shows for placeholder-bucketed reports, demo data, and any report whose reportID resolves to a sentinel — every one of those clicks ends on the not-found view.
Proposed fix
Centralize the guard inside navigateToDetailsPage so every caller is fixed at once, and fall through to the parent chat report when the directly-passed report is a placeholder bucket. The parent chat (policyExpenseChat / DM owning the IOU) is always loaded in Onyx alongside the IOU record and can render details.
// src/libs/ReportUtils.ts (replace the body at 6180-6193)functionnavigateToDetailsPage(report: OnyxEntry<Report>,backTo?: string,shouldUseActiveRoute?: boolean){constisSelfDMReport=isSelfDM(report);constisOneOnOneChatReport=isOneOnOneChat(report);constparticipantAccountID=getParticipantsAccountIDsForDisplay(report);if(isSelfDMReport||isOneOnOneChatReport){Navigation.navigate(ROUTES.PROFILE.getRoute(participantAccountID.at(0),isSelfDMReport||shouldUseActiveRoute ? Navigation.getActiveRoute() : backTo));return;}constreportID=report?.reportID;constisPlaceholderBucket=!reportID||reportID===CONST.REPORT.UNREPORTED_REPORT_ID||reportID===CONST.REPORT.TRASH_REPORT_ID||reportID===CONST.REPORT.SPLIT_REPORT_ID;if(isPlaceholderBucket){// Sentinel buckets ('0', '-1', '-2') have no Onyx report record;// navigating to them lands on the not-found page. Walk up to the parent chat instead.constparentChatReportID=report?.parentReportID;if(parentChatReportID){Navigation.navigate(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(parentChatReportID,backTo));}return;}Navigation.navigate(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(reportID,backTo));}
Then stop emitting the action when there's no resolvable target, so the menu doesn't advertise a no-op. In src/libs/ReportSecondaryActionUtils.ts, replace line 1015:
And the matching change at line 1098, using parentReport?.reportID (the IOU/expense report owning the transaction thread) since getSecondaryTransactionThreadActions already takes parentReport as a parameter:
navigateToDetailsPage is the only chokepoint for this navigation — fixing it there means every caller (the report-level menu in MoneyReportHeaderSecondaryActions.tsx:343, the transaction-thread menu in MoneyRequestHeaderSecondaryActions.tsx:400, AvatarWithDisplayName.tsx:230, HeaderView.tsx:314, ReportActionItemCreated.tsx:62) inherits the placeholder-bucket guard for free. The action-list change is defense in depth: without it, the menu still surfaces a "View details" item for unreported / trash / split transactions, then silently no-ops via the new early-return — the cleaner UX is to not render the entry at all when it can't resolve.
Rewriting each caller to pass chatReport / parentReport instead was considered but rejected: ReportDetailsPage is already designed to render three caseID branches (CASES.MONEY_REPORT, CASES.MONEY_REQUEST, CASES.DEFAULT at src/pages/ReportDetailsPage.tsx:257-267) for IOU reports, transaction threads, and chat threads respectively. The IDs the menus pass today are the right targets when they're real — the bug is only that the helper accepts sentinel placeholders without filtering them.
Please re-state the problem that we are trying to solve in this issue.
Clicking "View Details" from an expense/report actions menu renders the "Hmm... it's not here" not-found page instead of opening the details panel. This happens because navigateToDetailsPage() navigates without validating that report data is available in the Redux store.
What is the root cause of that problem?
The navigateToDetailsPage() function in src/libs/ReportUtils.ts:6121-6134 only checks if report?.reportID exists before navigating. It doesn't validate:
Whether the report object is fully hydrated with necessary fields
Whether report data fetching is complete
When data is missing, the destination component shows the not-found page.
What changes do you think we should make to fix this problem?
Add pre-flight validation to navigateToDetailsPage() and its callers to ensure report data is ready before navigation. If data is incomplete, skip navigation silently and log a warning.
Where should the changes be made?
1. src/libs/ReportUtils.ts (lines 6121-6134)
function navigateToDetailsPage(report: OnyxEntry<Report>, backTo?: string, shouldUseActiveRoute?: boolean) {
+ if (isEmptyObject(report)) {+ Log.warn('navigateToDetailsPage: Report data is empty, skipping navigation');+ return;+ }+
const isSelfDMReport = isSelfDM(report);
const isOneOnOneChatReport = isOneOnOneChat(report);
const participantAccountID = getParticipantsAccountIDsForDisplay(report);
if (isSelfDMReport || isOneOnOneChatReport) {
+ if (!participantAccountID?.length) {+ Log.warn('navigateToDetailsPage: Participant data missing, skipping navigation');+ return;+ }
Navigation.navigate(ROUTES.PROFILE.getRoute(participantAccountID.at(0), isSelfDMReport || shouldUseActiveRoute ? Navigation.getActiveRoute() : backTo));
return;
}
if (report?.reportID) {
Navigation.navigate(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(report?.reportID, backTo));
+ } else {+ Log.warn('navigateToDetailsPage: Report ID missing, skipping navigation');
}
}
Activity
melvin-bot commentedon May 6, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Eskalifer1 (
External)[-]Clicking "View Details" on an expense/report shows the "Hmm... it's not here" page[/-][+][$250] Clicking "View Details" on an expense/report shows the "Hmm... it's not here" page[/+]melvin-bot commentedon May 6, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022051945719176094675
Ltbltbltbltb commentedon May 6, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
Clicking View Details from an expense/report actions menu opens a Not Found page instead of the valid details view.
What is the root cause of that problem?
The same action key is used for report-level and transaction-level View Details:
src/CONST/index.ts#L1332andsrc/CONST/index.ts#L1386. The handlers currently callnavigateToDetailsPage()with the money request / expense report object in both flows. That helper builds a report-details route, but expense reports do not have the normal chat/report details page, so navigation lands on the “Hmm... it’s not here” screen.This affects both code paths that expose the menu: the report header View Details implementation and the transaction/expense header View Details implementation.
What changes do you think we should make in order to solve the problem?
Keep the fix at the menu handler level: when View Details is selected for a money request / expense report, navigate using the parent chat report that owns the details panel, not the money request report itself. For the single-transaction expense menu, use the same rule so both entry points are covered.
This is the narrowest fix: it preserves the existing
VIEW_DETAILSactions fromsrc/CONST/index.ts#L1332/src/CONST/index.ts#L1386, reusesnavigateToDetailsPage(), and only corrects which report object is passed from the two visible menu entry points.Contributor Details
aswin-s commentedon May 6, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a user deletes an expense or transaction from the details page on web, the app navigates to the target report but briefly renders the "Hmm... it's not here" (NotFoundPage) before the correct details page appears. This race condition occurs because the URL guard that suppresses the NotFoundPage is being cleared at the wrong time—on the source screen as it loses focus—rather than on the destination screen after it gains focus, causing the guard to become null before the destination screen's data stabilizes.
What is the root cause of that problem?
The bug originates in
src/pages/inbox/DeleteTransactionNavigateBackHandler.tsxat lines 19–20. A regression from PR #83613 inverted theisFocusedguard from!isFocusedtoisFocused, inverting the intended behavior.The causal chain: When deleting a transaction, the source
ReportScreencallsclearDeleteTransactionNavigateBackUrl()wrapped inInteractionManager.runAfterInteractions(). With the inverted guard (isFocused), this clear now fires when the source screen loses focus (navigating away). Meanwhile, the destinationReportDetailsPagedefers itsdeleteTransaction()call with anotherInteractionManager.runAfterInteractions()(line 1064). The destination'sReportNotFoundGuard(line 53 ofReportNotFoundGuard.tsx) uses!deleteTransactionNavigateBackUrlas its suppression guard:If the source's clear races ahead before the destination's Onyx writes propagate, the URL becomes null, the report thread no longer exists (deleted), and
shouldShowNotFoundPagebecomes true, briefly rendering the NotFoundPage.The working analog is
ReportNotFoundGuard.tsx(lines 53–64), which expects the URL to remain non-null as a suppression guard until the destination screen stabilizes.App/src/pages/inbox/ReportNotFoundGuard.tsx
Lines 53 to 64 in cab0b7b
What changes do you think we should make in order to solve the problem?
src/pages/inbox/DeleteTransactionNavigateBackHandler.tsxFunction:
DeleteTransactionNavigateBackHandlerEdit: Revert the isFocused guard at line 20 from
if (isFocused || ...)back toif (!isFocused || ...). This restores the pre-regression behavior whereclearDeleteTransactionNavigateBackUrl()fires only after the destination screen gains focus, ensuring theReportNotFoundGuardsuppression remains non-null until Onyx writes stabilize.Blast radius: Isolated to
DeleteTransactionNavigateBackHandler—a single-character guard inversion with no shared helpers modified. The component is mounted only insideReportScreen, with no callers passing props into the guard logic.What alternative solutions did you explore? (Optional)
Moving
clearDeleteTransactionNavigateBackUrl()into thedeleteTransaction()callback inReportDetailsPage.tsx(lines 1060–1067) was rejected because it couples clearing to a single call-site and silently breaks any other code path that sets the NVP without going throughReportDetailsPage'snavigateToTargetUrl. It also removes the architectural purpose ofDeleteTransactionNavigateBackHandleras the canonical clear-on-focus owner.yusufdeveloper2903 commentedon May 6, 2026
Proposal
What is the root cause of that problem?
I traced this back to the recent migration in
aaed2e394c1("Migrate all reportMetadata readers to reportLoadingState/reportLastVisitTimes") which changedsrc/pages/inbox/report/withReportOrNotFound.tsx#L78-L87to readisLoadingInitialReportActionsfromRAM_ONLY_REPORT_LOADING_STATE(the new RAM-only key) instead ofREPORT_METADATA(a persisted key).When the user clicks View Details from
MoneyReportHeaderSecondaryActions(src/components/MoneyReportHeaderActions/MoneyReportHeaderSecondaryActions.tsx#L342-L344) orMoneyRequestHeaderSecondaryActions(src/components/MoneyRequestHeaderSecondaryActions.tsx#L399-L401),navigateToDetailsPage()pushesr/<reportID>/detailsandwithReportOrNotFoundmounts. There it evaluates:Because
RAM_ONLY_REPORT_LOADING_STATEis registered as RAM-only insrc/setup/index.ts#L60-L73and the report we are already viewing hasisLoadingInitialReportActions: falsein it (set by the prioropenReportsuccess insrc/libs/actions/Report/index.ts#L1399-L1407), the first render of the new screen sees:reportLoadingState?.isLoadingInitialReportActions === false→shouldFetchReport = false,reportfromuseOnyxis stillundefinedfor one tick →isReportLoaded = false,isLoadingReportData !== falseis alsofalse,so
withReportOrNotFound.tsx#L101-L122skips the loading indicator and rendersNotFoundPage— the "Hmm… it's not here" screen — untilreportresolves on a later render. The same stale-flag race is already documented insrc/pages/inbox/LinkedActionNotFoundGuard.tsx#L88-L93:LinkedActionNotFoundGuarddefends against it withhasSeenLoadingCycle;withReportOrNotFounddoes not, which is why View Details now renders NotFoundPage on web after the migration.What changes do you think we should make in order to solve the problem?
I'd suppress
NotFoundPageuntil we've actually observed at least one mount tick where thereportsubscription has settled — i.e., don't conclude "not found" whilereportis stillundefinedfromuseOnyx. The cleanest way is to require BOTHisLoadingReportData === falseAND a settledreportvalue (not just truthiness of the report object):This preserves the legitimate "report truly missing" path: once
reporthas been read (even if it's an empty object),isReportSettledistrueandshouldShowNotFoundPageevaluates as before. It only blocks the false-positive flash where the RAM-only loading flag has resolved synchronously while the persistedreportcollection key hasn't yet — exactly the new condition the migration introduced.What alternative solutions did you explore? (Optional)
LinkedActionNotFoundGuard'shasSeenLoadingCycle(require we've seenisLoadingInitialReportActions === trueat least once before trustingfalse). This works but adds state and only helps reports that we re-openReport; reports we already loaded earlier this session never re-enter the loading cycle, so the stale-falserace still slips through on the very first tick.openReportunconditionally on mount insidewithReportOrNotFound. Rejected — re-fetches on every details navigation are wasteful and would mask the underlying timing issue rather than fix it.withReportOrNotFoundto readreportMetadata?.isLoadingInitialReportActions. Rejected — that key is no longer being written aftere34ca74f0dd, so the condition would always evaluate totrueand we'd refetch every time.15antonian commentedon May 6, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On web (NewDot), clicking View Details from the expense or report actions menu renders the "Hmm... it's not here" not-found page instead of opening the expected report details panel. This happens when the user is viewing an expense or report through the wide RHP (the
e/:reportIDorsearch/money-request-reportroutes that mount as super-wide right-panel views).What is the root cause of that problem?
The failure originates in
navigateToDetailsPageinsrc/libs/ReportUtils.ts:6131, which callsNavigation.navigate(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(...))unconditionally:When the user is inside
EXPENSE_REPORTorSEARCH_MONEY_REQUEST_REPORT(the super-wide RHP screens registered atlinkingConfig/config.ts:2139),Navigation.navigatecallslinkTo, which callsgetMinimalAction. That function drills into the current state by matching navigator names top-down. It matchesRIGHT_MODAL_NAVIGATORand descends into the super-wide RHP's inner state — which contains onlyEXPENSE_REPORT(a single screen ate/:reportID). The resulting minimal action targets that inner state key withpayload.name = REPORT_DETAILS. However,EXPENSE_REPORTis a leaf screen — it has noREPORT_DETAILSchild. The standard StackRouter cannot resolve this action, so the push silently fails or produces an unroutable path that hits theSCREENS.NOT_FOUND: '*'wildcard route, rendering the not-found page.The condition
isNavigatingToModalFromModalinRootStackRouter.ts:124— which would correctly handle modal-to-modal transitions — is never reached becausegetMinimalActionstrips theRIGHT_MODAL_NAVIGATORwrapper from the action before the router sees it.What changes do you think we should make in order to solve the problem?
In
navigateToDetailsPageinsrc/libs/ReportUtils.ts, checkNavigation.getReportRHPActiveRoute()before navigating. That function returns a non-empty string only when the user is inside a super-wide RHP (EXPENSE_REPORT or SEARCH_MONEY_REQUEST_REPORT). When that condition is true, useNavigation.dismissModal({afterTransition: () => Navigation.navigate(...)})instead of a direct navigate. This pattern — already used widely for modal-then-navigate flows inWorkspaceInviteMessageComponent.tsxand elsewhere — ensures the super-wide RHP is fully dismissed beforelinkToruns, sogetMinimalActionoperates on a navigation state that no longer has a locked-in RHP inner key, andREPORT_DETAILScan be pushed onto a freshRIGHT_MODAL_NAVIGATORstack without being swallowed. When not in a super-wide RHP, the existing direct navigate path is preserved.Compare branch: https://github.com/Expensify/App/compare/main...15antonian:App:fix/89724-view-details-rhp-context?expand=1
What alternative solutions did you explore? (Optional)
Option: Change
isNavigatingToModalFromModalinRootStackRouter.tsto detect super-wide RHP screens (EXPENSE_REPORT, SEARCH_MONEY_REQUEST_REPORT) and route them throughhandleNavigatingToModalFromModal. Rejected because that handler replaces the current modal rather than stacking a new one, which would close the expense view before the details panel appears — losing the user's place. It also widens the scope of a navigation primitive that has historically caused state corruption when applied too broadly.Option: Modify
getMinimalActionto detect when the inner target state has no matching screen and fall back to targeting the root state. Rejected becausegetMinimalActionis a low-level helper used across all navigation flows; changes there risk unintended regressions in other RHP and split-navigator transitions.Option: Pass a new
forceRootNavigatorflag toNavigation.navigateto skipgetMinimalActionentirely for this call. Rejected because the fix would need threading through multiple layers (navigate → linkTo → getMinimalAction) and adds API surface for a problem that is more cleanly solved at the call site.Compare branch: https://github.com/Expensify/App/compare/main...15antonian:App:fix/89724-view-details-rhp-context?expand=1
MelvinBot commentedon May 6, 2026
Proposal
What is the root cause of that problem?
The "View Details" action in
MoneyReportHeaderSecondaryActions.tsx:341-343andMoneyRequestHeaderSecondaryActions.tsx:399-401navigates tor/{reportID}/details, which rendersReportDetailsPagewrapped inwithReportOrNotFound.The HOC shows
NotFoundPagewhencanAccessReportreturnsfalse(line 103).canAccessReportrejects reports that haveerrorFields.notFoundset.The problem is an inconsistency between guards: the report screens that show the report (
SearchMoneyRequestReportPageat line 300-331 andReportNotFoundGuard) do not checkerrorFields.notFound, whilewithReportOrNotFounddoes. So a report with a stalenotFounderror is visible in the report view, but clicking "View Details" shows the Not Found page.Compounding this,
withReportOrNotFound'sopenReporteffect (line 91-99) skips callingopenReportwhenisReportLoadedistrue. Since the report data exists in Onyx (the user was just viewing it), the staleerrorFields.notFoundis never cleared by a freshopenReportsuccess response.What changes do you think we should make in order to solve the problem?
Two complementary fixes:
In
withReportOrNotFound: WhenisReportLoadedis true butcanAccessReportfails due toerrorFields.notFound, callopenReportto refresh the report data instead of immediately showing NotFoundPage. This gives the server a chance to clear the stale error.In
canAccessReportorwithReportOrNotFound: Consider clearingerrorFields.notFoundfrom the report when the report has valid data (has areportID, is not empty). If the report data exists in Onyx with real content, a stalenotFounderror from a prior failed API call should not permanently block access to details.The fix in option 1 is more conservative — it retries the API call before giving up. The fix in option 2 directly addresses the stale state.
What alternative solutions did you explore? (Optional)
SearchMoneyRequestReportPageandReportNotFoundGuardto also checkerrorFields.notFoundwas considered, but this would make the report inaccessible everywhere rather than fixing the inconsistency.openReportfailure data to explicitly clearerrorFields.notFoundwas considered, but the failure data shouldn't make assumptions about prior state.Investigation details
Navigation flow:
navigateToDetailsPagenavigates tor/{reportID}/details(ReportUtils.ts:6131-6132)withReportOrNotFoundreads report from Onyx, checkscanAccessReporterrorFields.notFoundis truthy →canAccessReportreturns false → NotFoundPage shownGuard inconsistency:
SearchMoneyRequestReportPagechecks: invalid reportID, pending deletion, deleted transactions, deleted parent action — noerrorFields.notFoundcheckReportNotFoundGuardchecks: invalid path, loading state, report existence — noerrorFields.notFoundcheckwithReportOrNotFound(wrappingReportDetailsPage) checkscanAccessReportwhich explicitly checkserrorFields.notFoundStale error persistence:
openReportsuccess data clearsnotFound:{ errorFields: { notFound: null } }withReportOrNotFoundskipsopenReportwhen report is already loaded (line 92)notFounderror is never clearedRecent migration (commit
aaed2e394c1):shouldFetchReportfrom using persistedreportMetadatato RAM-onlyreportLoadingStatereportLoadingStateis undefined (RAM cleared),shouldFetchReportbecomestrueopenReportcall if the report weren't loadednotFound), this doesn't helpNext Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.trasnake87 commentedon May 6, 2026
Proposal
Clicking View details from the secondary-action ("More") menu on an expense/report navigates to a route the destination cannot resolve, so
withReportOrNotFoundfalls through to the "Hmm... it's not here" page.Root cause
navigateToDetailsPageinsrc/libs/ReportUtils.ts:6180-6193is the single point that builds the destination URL for both menu entry points. After ruling out self-DMs and one-on-one chats, it pushes whateverreport.reportIDit was handed, with no validation:Two distinct ways the
reportIDit receives points at a record that isn't in thereport_Onyx collection:1 - Placeholder bucket IDs leak through to the route.
src/CONST/index.ts:1317-1319defines three sentinel report IDs:These are used as transaction grouping buckets, not real reports — they never have a corresponding
${ONYXKEYS.COLLECTION.REPORT}{id}entry. When a user opens an unreported expense (transaction whosereportID === '0'), the transaction-thread context resolvesreport.reportIDto that placeholder. The transaction-level handler insrc/components/MoneyRequestHeaderSecondaryActions.tsx:395-402then passes the placeholder straight in:Navigation.navigatelands onr/0/details(orr/-1/details,r/-2/details).withReportOrNotFound(src/pages/inbox/report/withReportOrNotFound.tsx:101-122) computesisReportLoaded = !isEmptyObject(report) && !!report?.reportID, sees no record, firesopenReport({reportID: '0'}), and oncereportLoadingState.isLoadingInitialReportActionsflips tofalse,shouldShowNotFoundPagebecomes true → "Hmm... it's not here."2 -
VIEW_DETAILSis pushed unconditionally even when the underlying report can't render details.src/libs/ReportSecondaryActionUtils.ts:1015and:1098both append the action with no guard:So the menu item shows for placeholder-bucketed reports, demo data, and any report whose
reportIDresolves to a sentinel — every one of those clicks ends on the not-found view.Proposed fix
Centralize the guard inside
navigateToDetailsPageso every caller is fixed at once, and fall through to the parent chat report when the directly-passed report is a placeholder bucket. The parent chat (policyExpenseChat/ DM owning the IOU) is always loaded in Onyx alongside the IOU record and can render details.Then stop emitting the action when there's no resolvable target, so the menu doesn't advertise a no-op. In
src/libs/ReportSecondaryActionUtils.ts, replace line 1015:And the matching change at line 1098, using
parentReport?.reportID(the IOU/expense report owning the transaction thread) sincegetSecondaryTransactionThreadActionsalready takesparentReportas a parameter:Why this approach
navigateToDetailsPageis the only chokepoint for this navigation — fixing it there means every caller (the report-level menu inMoneyReportHeaderSecondaryActions.tsx:343, the transaction-thread menu inMoneyRequestHeaderSecondaryActions.tsx:400,AvatarWithDisplayName.tsx:230,HeaderView.tsx:314,ReportActionItemCreated.tsx:62) inherits the placeholder-bucket guard for free. The action-list change is defense in depth: without it, the menu still surfaces a "View details" item for unreported / trash / split transactions, then silently no-ops via the new early-return — the cleaner UX is to not render the entry at all when it can't resolve.Rewriting each caller to pass
chatReport/parentReportinstead was considered but rejected:ReportDetailsPageis already designed to render threecaseIDbranches (CASES.MONEY_REPORT,CASES.MONEY_REQUEST,CASES.DEFAULTatsrc/pages/ReportDetailsPage.tsx:257-267) for IOU reports, transaction threads, and chat threads respectively. The IDs the menus pass today are the right targets when they're real — the bug is only that the helper accepts sentinel placeholders without filtering them.ohrytskov commentedon May 6, 2026
Proposal: Pre-Navigation Report Data Validation
Please re-state the problem that we are trying to solve in this issue.
Clicking "View Details" from an expense/report actions menu renders the "Hmm... it's not here" not-found page instead of opening the details panel. This happens because
navigateToDetailsPage()navigates without validating that report data is available in the Redux store.What is the root cause of that problem?
The
navigateToDetailsPage()function insrc/libs/ReportUtils.ts:6121-6134only checks ifreport?.reportIDexists before navigating. It doesn't validate:When data is missing, the destination component shows the not-found page.
What changes do you think we should make to fix this problem?
Add pre-flight validation to
navigateToDetailsPage()and its callers to ensure report data is ready before navigation. If data is incomplete, skip navigation silently and log a warning.Where should the changes be made?
1.
src/libs/ReportUtils.ts(lines 6121-6134)function navigateToDetailsPage(report: OnyxEntry<Report>, backTo?: string, shouldUseActiveRoute?: boolean) { + if (isEmptyObject(report)) { + Log.warn('navigateToDetailsPage: Report data is empty, skipping navigation'); + return; + } + const isSelfDMReport = isSelfDM(report); const isOneOnOneChatReport = isOneOnOneChat(report); const participantAccountID = getParticipantsAccountIDsForDisplay(report); if (isSelfDMReport || isOneOnOneChatReport) { + if (!participantAccountID?.length) { + Log.warn('navigateToDetailsPage: Participant data missing, skipping navigation'); + return; + } Navigation.navigate(ROUTES.PROFILE.getRoute(participantAccountID.at(0), isSelfDMReport || shouldUseActiveRoute ? Navigation.getActiveRoute() : backTo)); return; } if (report?.reportID) { Navigation.navigate(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(report?.reportID, backTo)); + } else { + Log.warn('navigateToDetailsPage: Report ID missing, skipping navigation'); } }2.
src/components/MoneyRequestHeaderSecondaryActions.tsx(lines 395-402)[CONST.REPORT.TRANSACTION_SECONDARY_ACTIONS.VIEW_DETAILS]: { value: CONST.REPORT.SECONDARY_ACTIONS.VIEW_DETAILS, text: translate('iou.viewDetails'), icon: expensifyIcons.Info, onSelected: () => { + if (isEmptyObject(report)) { + Log.warn('VIEW_DETAILS: Report data not available'); + return; + } navigateToDetailsPage(report, Navigation.getActiveRoute()); }, },3. Apply similar pattern to other callers:
src/components/AvatarWithDisplayName.tsxsrc/components/MoneyReportHeaderActions/MoneyReportHeaderSecondaryActions.tsxsrc/pages/inbox/HeaderView.tsxsrc/pages/inbox/report/ReportActionItemCreated.tsxExpected Result
Implementation Notes
Log(line 122),isEmptyObject(line 86) in ReportUtils.ts21 remaining items
mvtglobally commentedon May 30, 2026
Issue not reproducible during KI retests. (Third week)
melvin-bot commentedon Jun 1, 2026
@Eskalifer1 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Eskalifer1 commentedon Jun 2, 2026
Same as above!
mvtglobally commentedon Jun 5, 2026
Issue not reproducible during KI retests. (Fourth week)
melvin-bot commentedon Jun 5, 2026
@Eskalifer1 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
melvin-bot commentedon Jun 9, 2026
@Eskalifer1 Still overdue 6 days?! Let's take care of this!
melvin-bot commentedon Jun 11, 2026
@Eskalifer1 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!
mvtglobally commentedon Jun 13, 2026
Issue not reproducible during KI retests. (5th week) Closing. Please reopen if needed