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
[Due for payment 2026-08-12] [$250] [Exploratory] Report details - Not found page opened when clicking admin report header #94977
Version Number: v9.4.25-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:#93267 Email or phone of affected tester (no customers):ldaksjflkajdsflkjew@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: macOS chrome App Component: Other
Action Performed:
Open ND
Login with new account without + iteration
In onboarding steps, choose "Manage my team's expenses" > "1-4 employees" > "QuickBooks Online" > Click "Continue"
Root cause: The report details page and the chat screen use different not-found guards, and only the details guard rejects the admin room. When you tap the #admins header dropdown, it opens report details via withReportOrNotFound, which shows the "Not found" page whenever canAccessReport returns false. canAccessReport returns false if the room carries a (transient/stale) errorFields.notFound, or if #admins is treated as a default room the brand-new account can't yet access. The chat itself opens fine because ReportNotFoundGuard (used by ReportScreen) never calls canAccessReport — this is the asymmetry. This matches the diagnosis in the closely-related, now-closed #90898.
Proposal
What is the root cause of that problem?
Right after "Manage my team's expenses" onboarding, the account lands in the optimistically-created #admins room. Tapping the header dropdown navigates to report details, wrapped by withReportOrNotFound. That HOC computes shouldShowNotFoundPage = !isReportLoaded || !canAccessReport(report, betas, isReportArchived). Even though the room object is fully loaded, canAccessReport returns false because the freshly-created onboarding room briefly has errorFields.notFound set (this truthy value originates from the server response and is never cleared in time; the client only ever reads or clears it), and/or #admins is a default room the new account can't yet see. ReportScreen renders the same report without issue because its guard (ReportNotFoundGuard) checks only for an invalid path or a truly-absent report — it never consults canAccessReport or errorFields.notFound. The QuickBooks Online integration selection appears to matter only because the extra workspace/connection work lengthens the window before the room is fully persisted server-side, widening this transient race.
What changes do you think we should make in order to solve the problem?
Bring the report-details not-found guard in line with the chat guard so the two can't disagree for a report the user is actively viewing:
In withReportOrNotFound, do not treat a loaded report as "not found" purely because of a transient errorFields.notFound while the report is still being fetched/persisted (e.g. gate on the same loading/reportExists conditions ReportNotFoundGuard uses, rather than a raw canAccessReport check that fails on a stale flag).
And/or ensure the stale errorFields.notFound on the optimistically-created onboarding #admins room is cleared once the room is confirmed (the client already clears notFound to null in OpenReport success data — the gap is that details can render before that clear lands).
What alternative solutions did you explore? (Optional)
Clearing/ignoring errorFields.notFound specifically for onboarding-created rooms; or confirming (via backend/log investigation) whether the server should stop returning errorFields.notFound for a room it just created during onboarding.
The gate:withReportOrNotFound.tsx:116 — shouldShowNotFoundPage = !isReportLoaded || !canAccessReport(...), renders NotFoundPage when true.
canAccessReport:ReportUtils.ts:9321-9332 returns false on report.errorFields.notFoundor default-room-without-beta.
Chat's different guard:ReportNotFoundGuard.tsx:52-73 gates only on invalid path / report-absent-after-load. Never calls canAccessReport.
Optimistic creation: the #admins room is built fully-formed (real reportID, policyID, chatType: POLICY_ADMINS) in buildOptimisticWorkspaceChats and written in Policy.ts; no client code ever sets errorFields.notFound to a truthy value — it is only read or cleared to null (e.g. OpenReport success data). So the truthy value is server-originated and transient.
Confidence: Medium-High. The client-side guard asymmetry is confirmed with file:line evidence. The exact server-side trigger and why QuickBooks Online specifically widens the race window would benefit from production log confirmation for a repro requestID (checking whether the OpenReport/reconnect response for the admins reportID returns errorFields.notFound, and its timing relative to workspace creation).
Note on scope: the App-side guard fix above is fully actionable within Expensify/App. If the team prefers to stop the transient errorFields.notFound at the source, that part involves the backend and would need an internal engineer to confirm.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/94977) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
changed the title [-][Exploratory] Report details - Not found page opened when clicking admin report header[/-][+][$250] [Exploratory] Report details - Not found page opened when clicking admin report header[/+]on Jul 17, 2026
Please re-state the problem that we are trying to solve in this issue.
Clicking the dropdown icon on the admin room (#admins) header — for example right after completing the "Manage my team's expenses" onboarding flow — opens a Not found page instead of the report details page.
What is the root cause of that problem?
The header dropdown calls navigateToDetailsPage(report), which builds the details route from the currently active route rather than from the target report's own route:
The createDynamicRoute(DYNAMIC_ROUTES.REPORT_DETAILS.path) call is invoked without a base path, so createDynamicRoute falls back to Navigation.getActiveRoute() and appends details to whatever route is currently on top:
When the admin room is reached through the onboarding flow, the active route on top is not the report's own r/<reportID> route, so the resulting path does not carry a valid reportID. withReportOrNotFound then finds no loaded report for that route and renders the Not found page:
This is a regression from commit 4c77dd1cb2b ("fix: remove report_with_id"), which removed the explicit report base path from navigateToDetailsPage. The sibling function goBackToDetailsPage in the same file was left intact and still anchors the details route to the report's own reportID:
Log.warn('Missing reportID during navigation back to the details page');
What changes do you think we should make in order to solve the problem?
In navigateToDetailsPage, restore the explicit report base path so the details route is anchored to the target report rather than to whatever route happens to be active. Change the navigation call so it passes the report's own route as the base path — the same pattern the sibling goBackToDetailsPage already uses:
Pass ROUTES.REPORT_WITH_ID.getRoute(report.reportID) as the second argument to createDynamicRoute(DYNAMIC_ROUTES.REPORT_DETAILS.path, ...) at line 6115. This makes the constructed path r/<reportID>/details regardless of the current active route, so the details page always receives the correct reportID and no longer falls back to the Not found page.
ROUTES is already imported in the file and this mirrors the existing, working call at line 6135, keeping the two functions consistent.
Note on reproducing: the backend assigns the onboarding experiment arm per account, so a fresh account may draw a Concierge variant (the Side Panel opens the Concierge DM instead of the #admins room). If that happens, run await Onyx.merge('nvp_onboardingRHPVariant', 'rhpAdminsRoom'); in the dev console after onboarding completes — the open Side Panel switches to the #admins room immediately and the repro proceeds identically.
What alternative solutions did you explore? (Optional)
Anchoring inside createDynamicRoute itself (e.g. deriving the report route when the suffix is details) was considered, but that helper is generic across many dynamic routes and should not special-case report details. Fixing it at the call site in navigateToDetailsPage is the minimal, targeted change and matches the established pattern used by the other details-navigation helpers in the same file.
After verifying against the code and git history, the root cause wildan-m identified above is correct, and it supersedes the errorFields.notFound / canAccessReport hypothesis in my first comment. This is a deterministic route-construction regression, not a server-side race.
Root cause:navigateToDetailsPage calls createDynamicRoute(DYNAMIC_ROUTES.REPORT_DETAILS.path)without a base path. createDynamicRoute then falls back to Navigation.getActiveRoute() and appends details to whatever route is on top of the stack. Right after onboarding the active route is not the room's r/<reportID> route, so the built path carries no valid reportID. In withReportOrNotFound the route param reportID is then empty/wrong, so report loads empty and the !isReportLoaded branch fires (not !canAccessReport) → Not found page.
Regression: commit 4c77dd1cb2b ("fix: remove report_with_id") removed the ROUTES.REPORT_WITH_ID.getRoute(report.reportID) base-path argument from navigateToDetailsPage. The sibling goBackToDetailsPage was left intact and still anchors correctly — matching the asymmetry wildan-m describes.
Recommended fix: As proposed, restore the explicit report base path in navigateToDetailsPage by passing ROUTES.REPORT_WITH_ID.getRoute(report.reportID) as the second argument to createDynamicRoute, mirroring goBackToDetailsPage. This makes the path r/<reportID>/details regardless of the active route.
Verification evidence
Before the regression, navigateToDetailsPage passed the base path (diff of 4c77dd1cb2b):
withReportOrNotFound reads reportID purely as a route param (line 86) → useOnyx(REPORT + reportID) → isReportLoaded = !isEmptyObject(report) && !!report?.reportID (line 97) → shouldShowNotFoundPage = !isReportLoaded || !canAccessReport(...) (line 116). With no valid reportID in the path, the first operand short-circuits, so the not-found page is driven by !isReportLoaded.
The one runtime assumption not provable from code alone is that Navigation.getActiveRoute() is not r/<reportID> in this specific post-onboarding scenario — but the deterministic fallback mechanism and the exact repro (only reproducible when reaching the room via onboarding, not by opening details normally) both support it.
Correction note: my first comment attributed the not-found to canAccessReport returning false on a stale errorFields.notFound. That path exists but is not what fires here — the reportID never reaches the guard in a valid form, so the failure is upstream of canAccessReport.
Next Steps for Contributor+ team: To accept: the proposal from wildan-m above matches the verified root cause and fix — review and 👍 to assign, or reply @MelvinBot implement [this](https://github.com/Expensify/App/issues/94977) to have me open a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting this analysis.
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to the comment on the PR:
Link to the comment on the Issue:
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion:
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Activity
applause-bot commentedon Jun 30, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/e486ed5dc8ab8f993918c9f5750a8f593033bf3d3fd3898e6b703d9714cd58eb
MelvinBot commentedon Jul 17, 2026
Issue Analysis
Root cause: The report details page and the chat screen use different not-found guards, and only the details guard rejects the admin room. When you tap the
#adminsheader dropdown, it opens report details viawithReportOrNotFound, which shows the "Not found" page whenevercanAccessReportreturnsfalse.canAccessReportreturnsfalseif the room carries a (transient/stale)errorFields.notFound, or if#adminsis treated as a default room the brand-new account can't yet access. The chat itself opens fine becauseReportNotFoundGuard(used byReportScreen) never callscanAccessReport— this is the asymmetry. This matches the diagnosis in the closely-related, now-closed #90898.Proposal
What is the root cause of that problem?
Right after "Manage my team's expenses" onboarding, the account lands in the optimistically-created
#adminsroom. Tapping the header dropdown navigates to report details, wrapped bywithReportOrNotFound. That HOC computesshouldShowNotFoundPage = !isReportLoaded || !canAccessReport(report, betas, isReportArchived). Even though the room object is fully loaded,canAccessReportreturnsfalsebecause the freshly-created onboarding room briefly haserrorFields.notFoundset (this truthy value originates from the server response and is never cleared in time; the client only ever reads or clears it), and/or#adminsis a default room the new account can't yet see.ReportScreenrenders the same report without issue because its guard (ReportNotFoundGuard) checks only for an invalid path or a truly-absent report — it never consultscanAccessReportorerrorFields.notFound. The QuickBooks Online integration selection appears to matter only because the extra workspace/connection work lengthens the window before the room is fully persisted server-side, widening this transient race.What changes do you think we should make in order to solve the problem?
Bring the report-details not-found guard in line with the chat guard so the two can't disagree for a report the user is actively viewing:
withReportOrNotFound, do not treat a loaded report as "not found" purely because of a transienterrorFields.notFoundwhile the report is still being fetched/persisted (e.g. gate on the same loading/reportExistsconditionsReportNotFoundGuarduses, rather than a rawcanAccessReportcheck that fails on a stale flag).errorFields.notFoundon the optimistically-created onboarding#adminsroom is cleared once the room is confirmed (the client already clearsnotFoundtonullinOpenReportsuccess data — the gap is that details can render before that clear lands).What alternative solutions did you explore? (Optional)
Clearing/ignoring
errorFields.notFoundspecifically for onboarding-created rooms; or confirming (via backend/log investigation) whether the server should stop returningerrorFields.notFoundfor a room it just created during onboarding.Investigation details & evidence
Navigation path: header dropdown press →
HeaderView.tsx:359-362→navigateToDetailsPage(ReportUtils.ts:6364-6377) →DynamicReportDetailsPage, wrapped bywithReportOrNotFound().The gate:
withReportOrNotFound.tsx:116—shouldShowNotFoundPage = !isReportLoaded || !canAccessReport(...), rendersNotFoundPagewhen true.canAccessReport:ReportUtils.ts:9321-9332returnsfalseonreport.errorFields.notFoundor default-room-without-beta.Chat's different guard:
ReportNotFoundGuard.tsx:52-73gates only on invalid path / report-absent-after-load. Never callscanAccessReport.Optimistic creation: the
#adminsroom is built fully-formed (realreportID,policyID,chatType: POLICY_ADMINS) inbuildOptimisticWorkspaceChatsand written inPolicy.ts; no client code ever setserrorFields.notFoundto a truthy value — it is only read or cleared tonull(e.g.OpenReportsuccess data). So the truthy value is server-originated and transient.Confidence: Medium-High. The client-side guard asymmetry is confirmed with file:line evidence. The exact server-side trigger and why QuickBooks Online specifically widens the race window would benefit from production log confirmation for a repro requestID (checking whether the
OpenReport/reconnect response for the adminsreportIDreturnserrorFields.notFound, and its timing relative to workspace creation).Note on scope: the App-side guard fix above is fully actionable within Expensify/App. If the team prefers to stop the transient
errorFields.notFoundat the source, that part involves the backend and would need an internal engineer to confirm.Related issues
errorFields.notFound/ guard-asymmetry root cause.Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/94977)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
melvin-bot commentedon Jul 17, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @marufsharifi (
External)melvin-bot commentedon Jul 17, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022078173635597120579
[-][Exploratory] Report details - Not found page opened when clicking admin report header[/-][+][$250] [Exploratory] Report details - Not found page opened when clicking admin report header[/+]wildan-m commentedon Jul 17, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
Clicking the dropdown icon on the admin room (#admins) header — for example right after completing the "Manage my team's expenses" onboarding flow — opens a Not found page instead of the report details page.
What is the root cause of that problem?
The header dropdown calls
navigateToDetailsPage(report), which builds the details route from the currently active route rather than from the target report's own route:App/src/libs/ReportUtils.ts
Lines 6104 to 6117 in 0d0e0d8
The
createDynamicRoute(DYNAMIC_ROUTES.REPORT_DETAILS.path)call is invoked without a base path, socreateDynamicRoutefalls back toNavigation.getActiveRoute()and appendsdetailsto whatever route is currently on top:App/src/libs/Navigation/helpers/dynamicRoutesUtils/createDynamicRoute.ts
Lines 64 to 73 in 0d0e0d8
When the admin room is reached through the onboarding flow, the active route on top is not the report's own
r/<reportID>route, so the resulting path does not carry a validreportID.withReportOrNotFoundthen finds no loaded report for that route and renders the Not found page:App/src/pages/inbox/report/withReportOrNotFound.tsx
Lines 85 to 128 in 0d0e0d8
This is a regression from commit
4c77dd1cb2b("fix: remove report_with_id"), which removed the explicit report base path fromnavigateToDetailsPage. The sibling functiongoBackToDetailsPagein the same file was left intact and still anchors the details route to the report's own reportID:App/src/libs/ReportUtils.ts
Lines 6131 to 6137 in 0d0e0d8
What changes do you think we should make in order to solve the problem?
In
navigateToDetailsPage, restore the explicit report base path so the details route is anchored to the target report rather than to whatever route happens to be active. Change the navigation call so it passes the report's own route as the base path — the same pattern the siblinggoBackToDetailsPagealready uses:Pass
ROUTES.REPORT_WITH_ID.getRoute(report.reportID)as the second argument tocreateDynamicRoute(DYNAMIC_ROUTES.REPORT_DETAILS.path, ...)at line 6115. This makes the constructed pathr/<reportID>/detailsregardless of the current active route, so the details page always receives the correctreportIDand no longer falls back to the Not found page.ROUTESis already imported in the file and this mirrors the existing, working call at line 6135, keeping the two functions consistent.Compare branch: https://github.com/Expensify/App/compare/main...wildan-m:App:wildan/94977-details-page-report-base-path?expand=1
Result
Before
Kapture.2026-07-21.at.07.53.04.mp4
After
Kapture.2026-07-21.at.07.56.51.mp4
Note on reproducing: the backend assigns the onboarding experiment arm per account, so a fresh account may draw a Concierge variant (the Side Panel opens the Concierge DM instead of the #admins room). If that happens, run
await Onyx.merge('nvp_onboardingRHPVariant', 'rhpAdminsRoom');in the dev console after onboarding completes — the open Side Panel switches to the #admins room immediately and the repro proceeds identically.What alternative solutions did you explore? (Optional)
Anchoring inside
createDynamicRouteitself (e.g. deriving the report route when the suffix isdetails) was considered, but that helper is generic across many dynamic routes and should not special-case report details. Fixing it at the call site innavigateToDetailsPageis the minimal, targeted change and matches the established pattern used by the other details-navigation helpers in the same file.MelvinBot commentedon Jul 17, 2026
Issue Analysis (updated — corrects my earlier comment)
After verifying against the code and git history, the root cause
wildan-midentified above is correct, and it supersedes theerrorFields.notFound/canAccessReporthypothesis in my first comment. This is a deterministic route-construction regression, not a server-side race.Root cause:
navigateToDetailsPagecallscreateDynamicRoute(DYNAMIC_ROUTES.REPORT_DETAILS.path)without a base path.createDynamicRoutethen falls back toNavigation.getActiveRoute()and appendsdetailsto whatever route is on top of the stack. Right after onboarding the active route is not the room'sr/<reportID>route, so the built path carries no validreportID. InwithReportOrNotFoundthe route paramreportIDis then empty/wrong, soreportloads empty and the!isReportLoadedbranch fires (not!canAccessReport) → Not found page.Regression: commit
4c77dd1cb2b("fix: remove report_with_id") removed theROUTES.REPORT_WITH_ID.getRoute(report.reportID)base-path argument fromnavigateToDetailsPage. The siblinggoBackToDetailsPagewas left intact and still anchors correctly — matching the asymmetrywildan-mdescribes.Recommended fix: As proposed, restore the explicit report base path in
navigateToDetailsPageby passingROUTES.REPORT_WITH_ID.getRoute(report.reportID)as the second argument tocreateDynamicRoute, mirroringgoBackToDetailsPage. This makes the pathr/<reportID>/detailsregardless of the active route.Verification evidence
navigateToDetailsPagepassed the base path (diff of4c77dd1cb2b):goBackToDetailsPage, confirming it was left anchored.createDynamicRoutefallback:const routePath = basePath ?? Navigation.getActiveRoute();withReportOrNotFoundreadsreportIDpurely as a route param (line 86) →useOnyx(REPORT + reportID)→isReportLoaded = !isEmptyObject(report) && !!report?.reportID(line 97) →shouldShowNotFoundPage = !isReportLoaded || !canAccessReport(...)(line 116). With no validreportIDin the path, the first operand short-circuits, so the not-found page is driven by!isReportLoaded.Navigation.getActiveRoute()is notr/<reportID>in this specific post-onboarding scenario — but the deterministic fallback mechanism and the exact repro (only reproducible when reaching the room via onboarding, not by opening details normally) both support it.Correction note: my first comment attributed the not-found to
canAccessReportreturningfalseon a staleerrorFields.notFound. That path exists but is not what fires here — the reportID never reaches the guard in a valid form, so the failure is upstream ofcanAccessReport.Next Steps for Contributor+ team:
To accept: the proposal from
wildan-mabove matches the verified root cause and fix — review and 👍 to assign, or reply@MelvinBot implement [this](https://github.com/Expensify/App/issues/94977)to have me open a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting this analysis.
34 remaining items
marufsharifi commentedon Aug 10, 2026
BugZero Checklist:
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to the comment on the PR:
Link to the comment on the Issue:
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion:
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue: https://github.com/Expensify/Expensify/issues/671507
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-670d-a625-62d9-e01150ed8ff4melvin-bot commentedon Aug 10, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Aug 11, 2026
Payment Summary
Resolving PRs:
Upwork Job
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon Aug 13, 2026
Payment Summary
Contributor: @lorretheboy paid $250 via Upwork
Contributor+: @marufsharifi paid $250 via Upwork
Both, can you please accept the job below? Please reply here and tag me once you have.
https://www.upwork.com/jobs/~022078173635597120579
lorretheboy commentedon Aug 14, 2026
@mallenexpensify Thanks. I accepted the job
marufsharifi commentedon Aug 14, 2026
@mallenexpensify, I've accepted the offer. thanks.
mallenexpensify commentedon Aug 18, 2026
@marufsharifi @lorretheboy paid, summary updated above. Thx.