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-06-03] [$250] Workspace - LHN is lost when user navigate to deleted workspace link #90520
When clicking a workspace URL from a chat, linkTo() detects a cross-tab navigation and pushes a new TAB_NAVIGATOR onto the root stack. The root stack then looks like: [TAB_NAVIGATOR[0] (Inbox), TAB_NAVIGATOR[1] (Workspace)].
When the workspace is deleted and the "Not here" page shows, clicking "Go back to home page" calls goBackToHome(), which calls goBack(ROUTES.HOME). This resolves to goUp(), which tries to find an underlying TAB_NAVIGATOR with SCREENS.HOME already active. Since the original TAB_NAVIGATOR[0] has REPORTS_SPLIT_NAVIGATOR (Inbox) active — not HOME — the check fails and it falls through to a jumpTo(HOME)within the pushed TAB_NAVIGATOR[1]. The user ends up on the HomePage dashboard inside the pushed navigator, with the original navigator (containing the LHN/Inbox) trapped underneath and unreachable.
Additionally, the "Not here" page uses ForceFullScreenView with shouldForceFullScreen=true, which registers isBlockingViewVisible=true. On web, inactive tabs are hidden via display: none (not unmounted), so the cleanup never fires and isBlockingViewVisible stays true, hiding the tab bar on narrow layout.
Notably, the back button handler in goBackFromWorkspaceSettingPages() correctly detects the underlying Inbox tab and calls dismissModal() to pop the pushed TAB_NAVIGATOR — but goBackToHome() does not have this logic.
What changes do you think we should make in order to solve the problem?
In goBackToHome(), before calling goBack(ROUTES.HOME), check if the current navigation state has a pushed TAB_NAVIGATOR (i.e., root stack has multiple TAB_NAVIGATOR routes). If so, pop the pushed TAB_NAVIGATOR (similar to how goBackFromWorkspaceSettingPages does it) to return to the original navigator containing the Inbox/LHN, rather than jumping tabs within the pushed one.
Alternatively, modify the goUp() logic to broaden the underlying TAB_NAVIGATOR check — instead of requiring the underlying navigator to have HOME as its active tab, check for any underlying TAB_NAVIGATOR and pop to it.
What alternative solutions did you explore? (Optional)
Change onLinkPress in WorkspaceInitialPage from Navigation.goBackToHome to use Navigation.dismissModal (like the back button already does) — this would pop the pushed navigator directly. However, this is a narrower fix that doesn't address the general problem in goBackToHome().
Fix ForceFullScreenView cleanup to handle the freezeOnBlur/display:none case by removing the blocking key when the screen loses focus (using useIsFocused). This would fix the tab bar hiding symptom but not the underlying pushed-navigator trap.
Related issue
Expensify/App#69850 — tracking issue for ensuring error pages are recoverable, which is directly related to this stuck state.
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.
The "Go back to home page" link on the deleted-workspace "Not here" page now lands users on the new Home tab instead of the Inbox where the LHN lives.
After PR #88563 ([commit 6c46ef3](https://github.com/Expensify/App/commit/6c46ef39786816cd91207f0ee3d3f1dcac44daaf), April 23 — "Navigate to Home instead of Inbox in goBackToHome"), Navigation.goBackToHome() resolves to ROUTES.HOME, not ROUTES.INBOX:
The deleted-workspace path runs through AccessOrNotFoundWrapper.PageNotFoundFallback → NotFoundPage, where the active route is the workspace screen (e.g. WORKSPACE_OVERVIEW / WORKSPACE.INITIAL), not SCREENS.NOT_FOUND. So isOnGenericErrorScreen is false, fullPageNotFoundViewProps.onLinkPress isn't passed, the FullPageNotFoundView default fires, and the user lands on TAB_NAVIGATOR > SCREENS.HOME — a tab the LHN doesn't live on. On wide layout (Windows Chrome here) the LHN is part of REPORTS_SPLIT_NAVIGATOR, so the user sees it disappear and has no in-page way to recover, matching the "page is stuck, LHN options are not displayed" symptom.
The back arrow on the same PageNotFoundFallback does preserve the LHN — it branches on isPolicyNotAccessible and calls goBackFromWorkspaceSettingPages:
So the back arrow restores the LHN; the link below it doesn't. The two share the screen but use divergent exit routes.
What changes do you think we should make in order to solve the problem?
Mirror the back-button branch on the link in PageNotFoundFallback. When the policy is inaccessible (the deleted-workspace and similar cases), route the link through the same goBackFromWorkspaceSettingPages helper that already knows how to land the user back on the LHN-bearing tab:
🚨 Edited by proposal-police: This proposal was edited at 2026-05-13 14:24:02 UTC.
Replaces my earlier proposal: the media shows the copied workspace share URL resolves to /workspaces/<policyID>/overview, so the reproduced NotFound view is owned by WorkspacePageWithSections, not WorkspaceInitialPage.
Proposal
Please re-state the problem that we are trying to solve in this issue.
After deleting a workspace, opening the copied workspace share URL shows the expected "Not here" page. Pressing "Go back to home page" should return the user to a normal app surface with the LHN/report list available, but it instead lands on the standalone Home tab where the report LHN is gone.
What is the root cause of that problem?
The video shows the clicked URL ending on /workspaces/<policyID>/overview, which maps to the workspace profile/overview screen inside the workspace split navigator:
// When we create a new workspaces, the policy prop will not be set on the first render. Therefore, we have to delay rendering until it has been set in Onyx.
shouldShowLoading={policy===undefined}
shouldUseScrollView
shouldShowOfflineIndicatorInWideScreen
shouldShowNonAdmin
icon={illustrationIcons.Building}
shouldShowNotFoundPage={policy===undefined}
onBackButtonPress={handleBackButtonPress}
When the deleted workspace policy is empty/inaccessible, WorkspacePageWithSections sets shouldShow for the blocking NotFound view, and its back-button path already recovers with goBackFromWorkspaceSettingPages():
So the overview NotFound page has two divergent exits: the back button returns to the LHN-capable workspace/inbox context, but the "Go back to home page" link sends the user to a tab that does not own the LHN.
What changes do you think we should make in order to solve the problem?
In WorkspacePageWithSections, use the same workspace NotFound recovery path for the NotFound link that the back button already uses. The cleanest shape is to extract the shouldShow branch from handleOnBackButtonPress into a verb-named helper such as recoverFromWorkspaceNotFound, call goBackFromWorkspaceSettingPages() there, and pass that helper to both FullPageNotFoundView.onBackButtonPress and FullPageNotFoundView.onLinkPress while the blocking workspace NotFound view is shown.
Add a focused test for the workspace overview NotFound state: start from an Inbox/report split, navigate to a deleted/inaccessible /workspaces/:policyID/overview route, press the NotFound link, and assert the app returns to the reports split/Inbox context instead of SCREENS.HOME. The same test should cover the current back-button behavior so the two exits stay aligned.
Scope boundaries: files touched should be src/pages/workspace/WorkspacePageWithSections.tsx at the NotFound recovery/link callback plus a focused navigation or component test near the existing navigation/workspace tests. Platforms affected: all platforms via shared navigation, with the reproduced failure on Windows Chrome. Code paths not touched: global Navigation.goBackToHome(), generic NotFoundPage for unknown routes like /a/hello, FullPageNotFoundView defaults, workspace deletion API/Onyx data, and unrelated non-workspace NotFound screens. API/backend changes: none.
What alternative solutions did you explore? (Optional)
My earlier draft targeted WorkspaceInitialPage, but the reviewed media shows the reproduced URL is /workspaces/<policyID>/overview; WorkspaceInitialPage is the bare /workspaces/:policyID route and is not the screen shown in the failing video.
A proposal that patches AccessOrNotFoundWrapper mirrors the right idea for workspace subpages that use that wrapper, but it does not fix the reproduced overview route because WorkspaceOverviewPage renders its NotFound state through WorkspacePageWithSections. A proposal that changes removeScreenFromNavigationState() is also not the right boundary for this video path because WorkspacePageWithSections does not call that helper.
Changing goBackToHome() globally back to ROUTES.INBOX would restore the LHN here, but it would also undo the intentional generic NotFound behavior where unknown routes like /a/hello recover to the Home tab. Keeping the fix in the workspace overview NotFound wrapper fixes the reported route without changing generic NotFound behavior.
The "Go back to home page" link on the "Not here" page calls Navigation.goBackToHome(), which was recently changed to navigate to ROUTES.HOME instead of ROUTES.INBOX (commit 6c46ef3):
// We want to keep the report screen in the split navigator on wide layout.
if(!isNarrowLayout){
return;
}
// This set the right route in this split navigator.
goBack(ROUTES.HOME);
}
ROUTES.HOME (SCREENS.HOME) and ROUTES.INBOX (SCREENS.INBOX) are two different sibling tabs inside TAB_NAVIGATOR. The LHN/reports list lives on the Inbox tab inside REPORTS_SPLIT_NAVIGATOR, while SCREENS.HOME is a standalone tab with no LHN at all:
So after a user lands on the "Not here" page for a deleted workspace and taps "Go back to home page", goBackToHome() pops them onto the bare Home tab — which has no LHN options — instead of back to the Inbox tab where the LHN lives. That matches the reported symptom: "the page becomes stuck… hiding all LHN options".
The previous behaviour (goBack(ROUTES.INBOX)) was actually correct for this link: the "home page" the BlockingView refers to is the user's report list (the LHN). The rename made the function literal-name-correct but functionally wrong.
What changes do you think we should make in order to solve the problem?
I'd revert the destination back to ROUTES.INBOX so the link returns the user to the LHN, which is what every existing caller of goBackToHome() (workspace not-found, report not-found, generic 404, etc.) actually wants:
function goBackToHome() {
const isNarrowLayout = getIsNarrowLayout();
// This set the right split navigator.
- goBack(ROUTES.HOME);+ goBack(ROUTES.INBOX);
// We want to keep the report screen in the split navigator on wide layout.
if (!isNarrowLayout) {
return;
}
// This set the right route in this split navigator.
- goBack(ROUTES.HOME);+ goBack(ROUTES.INBOX);
}
Since the earlier PR also deleted a workaround in src/pages/ErrorPage/NotFoundPage.tsx for the generic error screen (which explicitly wanted ROUTES.HOME), we should restore that one branch so the generic 404 still lands on the Home tab while every contextual "Not here" (workspace deleted, report not accessible, etc.) lands back on the LHN:
(plus re-adding the useRoute() / isOnGenericErrorScreen check that was removed alongside it).
What alternative solutions did you explore? (Optional)
Rename goBackToHome → goBackToInbox and keep ROUTES.INBOX. Cleaner semantically, but it's a wider rename touching ~all call sites for no behaviour gain.
Make SCREENS.HOME render the LHN. That would mean restructuring the tab hierarchy so the "Home" tab embeds REPORTS_SPLIT_NAVIGATOR, which is a much larger refactor and changes the meaning of the new Home tab introduced by the recent navigation overhaul.
Change the BlockingView link text to "Go back to inbox" and keep ROUTES.HOME. This fixes the wording mismatch the original PR was trying to address, but still leaves the user on a tab without an LHN, so the actual user-visible bug ("LHN is lost") stays.
Reverting the route is the smallest, lowest-risk fix that restores the intended UX.
changed the title [-]Workspace - LHN is lost when user navigate to deleted workspace link[/-][+][$250] Workspace - LHN is lost when user navigate to deleted workspace link[/+]on May 13, 2026
Please re-state the problem that we are trying to solve in this issue.
When a user navigates to the URL of a deleted workspace, the "Not here" page is shown correctly. However, clicking "Go back to home page" leaves the user stuck — the LHN is no longer visible and no navigation is possible.
What is the root cause of that problem?
The root cause is in AccessOrNotFoundWrapper, where two separate side effects fire simultaneously when a deleted workspace URL is visited.
First, because isPolicyNotAccessible is true, shouldShowNotFoundPage is set to true and PageNotFoundFallback renders the "Not here" view. Its "Go back to home page" link calls Navigation.goBackToHome().
Second, a useEffect also keyed on isPolicyNotAccessible calls Navigation.removeScreenFromNavigationState(SCREENS.WORKSPACE.INITIAL). This dispatches CommonActions.reset() against the root navigator, stripping the WORKSPACE.INITIAL route out of the navigation stack. This reset happens before (or concurrently with) the user pressing "Go back to home page", leaving the navigation state in an inconsistent shape. When goBackToHome() then calls goBack(ROUTES.HOME) it has no valid history to return to, so the navigator is effectively stuck and the LHN never re-renders.
The removeScreenFromNavigationState call was designed for a scenario where the user is already inside the workspace navigator and their access is revoked — it cleans up the INITIAL screen so the back stack collapses gracefully. But when the user arrives via a direct pasted URL (not from within the workspace navigator), the INITIAL screen may not even be on the stack, or removing it leaves the stack empty, which is what causes the broken state.
What changes do you think we should make in order to solve the problem?
The removeScreenFromNavigationState(SCREENS.WORKSPACE.INITIAL) call should be guarded so it only fires when SCREENS.WORKSPACE.INITIAL actually exists in the current root navigation state. Before dispatching the reset, check whether any route in navigationRef.getRootState().routes contains a workspace split navigator that has WORKSPACE.INITIAL as an active route. If the screen is not present (the user arrived via a direct link, not via the in-app workspace list), the effect should skip the removeScreenFromNavigationState call entirely and instead delegate navigation to goBackFromWorkspaceSettingPages(), which already handles both the "came from inbox" and "came from workspaces list" cases correctly.
Concretely, inside the useEffect at lines 201-206 of AccessOrNotFoundWrapper.tsx, add a check using navigationRef.getRootState() to determine whether SCREENS.WORKSPACE.INITIAL is actually present in the stack before calling removeScreenFromNavigationState. If it is not present, call goBackFromWorkspaceSettingPages() instead (or simply return early and let the PageNotFoundFallback's own back-button handler manage navigation). This ensures the navigation state is never reset to an empty/broken shape when the user arrives at a deleted workspace via a direct URL.
What alternative solutions did you explore? (Optional)
An alternative would be to fix goBackToHome() to be more resilient when the navigation stack is empty or has fewer routes than expected — for example, by falling back to navigating to ROUTES.HOME via Navigation.navigate() instead of goBack() when no valid back history exists. However, this treats a symptom rather than the cause: the navigation state should never be corrupted in the first place by a premature reset that removes a screen that is not there.
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.83-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@jjcoffee The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
[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.
[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: N/A
[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
MelvinBot commentedon May 13, 2026
Proposal
What is the root cause of that problem?
When clicking a workspace URL from a chat,
linkTo()detects a cross-tab navigation and pushes a newTAB_NAVIGATORonto the root stack. The root stack then looks like:[TAB_NAVIGATOR[0] (Inbox), TAB_NAVIGATOR[1] (Workspace)].When the workspace is deleted and the "Not here" page shows, clicking "Go back to home page" calls
goBackToHome(), which callsgoBack(ROUTES.HOME). This resolves togoUp(), which tries to find an underlyingTAB_NAVIGATORwithSCREENS.HOMEalready active. Since the originalTAB_NAVIGATOR[0]hasREPORTS_SPLIT_NAVIGATOR(Inbox) active — notHOME— the check fails and it falls through to ajumpTo(HOME)within the pushedTAB_NAVIGATOR[1]. The user ends up on the HomePage dashboard inside the pushed navigator, with the original navigator (containing the LHN/Inbox) trapped underneath and unreachable.Additionally, the "Not here" page uses
ForceFullScreenViewwithshouldForceFullScreen=true, which registersisBlockingViewVisible=true. On web, inactive tabs are hidden viadisplay: none(not unmounted), so the cleanup never fires andisBlockingViewVisiblestays true, hiding the tab bar on narrow layout.Notably, the back button handler in
goBackFromWorkspaceSettingPages()correctly detects the underlying Inbox tab and callsdismissModal()to pop the pushedTAB_NAVIGATOR— butgoBackToHome()does not have this logic.What changes do you think we should make in order to solve the problem?
In
goBackToHome(), before callinggoBack(ROUTES.HOME), check if the current navigation state has a pushedTAB_NAVIGATOR(i.e., root stack has multipleTAB_NAVIGATORroutes). If so, pop the pushedTAB_NAVIGATOR(similar to howgoBackFromWorkspaceSettingPagesdoes it) to return to the original navigator containing the Inbox/LHN, rather than jumping tabs within the pushed one.Alternatively, modify the
goUp()logic to broaden the underlyingTAB_NAVIGATORcheck — instead of requiring the underlying navigator to haveHOMEas its active tab, check for any underlyingTAB_NAVIGATORand pop to it.What alternative solutions did you explore? (Optional)
onLinkPressinWorkspaceInitialPagefromNavigation.goBackToHometo useNavigation.dismissModal(like the back button already does) — this would pop the pushed navigator directly. However, this is a narrower fix that doesn't address the general problem ingoBackToHome().ForceFullScreenViewcleanup to handle thefreezeOnBlur/display:nonecase by removing the blocking key when the screen loses focus (usinguseIsFocused). This would fix the tab bar hiding symptom but not the underlying pushed-navigator trap.Related issue
Expensify/App#69850 — tracking issue for ensuring error pages are recoverable, which is directly related to this stuck state.
Next 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.yusufdeveloper2903 commentedon May 13, 2026
Proposal
What is the root cause of that problem?
The "Go back to home page" link on the deleted-workspace "Not here" page now lands users on the new Home tab instead of the Inbox where the LHN lives.
After PR #88563 ([commit 6c46ef3
](https://github.com/Expensify/App/commit/6c46ef39786816cd91207f0ee3d3f1dcac44daaf), April 23 — "Navigate to Home instead of Inbox in goBackToHome"),Navigation.goBackToHome() resolves to ROUTES.HOME, not ROUTES.INBOX:App/src/libs/Navigation/Navigation.ts
Lines 608 to 621 in d63051f
ROUTES.HOME is registered as a sibling tab to the Inbox inside TAB_NAVIGATOR, not its initial route:
App/src/libs/Navigation/linkingConfig/config.ts
Lines 2216 to 2229 in d63051f
HomePage renders dashboard widgets only — no chat list and no LHN:
App/src/pages/home/HomePage.tsx
Lines 28 to 107 in d63051f
FullPageNotFoundView uses goBackToHome as the default link handler:
App/src/components/BlockingViews/FullPageNotFoundView.tsx
Line 77 in d63051f
NotFoundPage only sidesteps that default when the route is the generic SCREENS.NOT_FOUND:
App/src/pages/ErrorPage/NotFoundPage.tsx
Line 53 in d63051f
The deleted-workspace path runs through AccessOrNotFoundWrapper.PageNotFoundFallback → NotFoundPage, where the active route is the workspace screen (e.g. WORKSPACE_OVERVIEW / WORKSPACE.INITIAL
), notSCREENS.NOT_FOUND. So isOnGenericErrorScreen is false, fullPageNotFoundViewProps.onLinkPress isn't passed, the FullPageNotFoundView default fires, and the user lands on TAB_NAVIGATOR > SCREENS.HOME — a tab the LHN doesn't live on. On wide layout (Windows Chrome here) the LHN is part of REPORTS_SPLIT_NAVIGATOR, so the user sees it disappear and has no in-page way to recover, matching the "page is stuck, LHN options are not displayed" symptom.The back arrow on the same PageNotFoundFallback does preserve the LHN — it branches on isPolicyNotAccessible and calls goBackFromWorkspaceSettingPages:
App/src/pages/workspace/AccessOrNotFoundWrapper.tsx
Lines 120 to 126 in d63051f
…which dismisses back to the Inbox when the previous root route was REPORTS_SPLIT_NAVIGATOR, otherwise routes to the workspaces list:
App/src/libs/Navigation/helpers/goBackFromWorkspaceSettingPages.ts
Lines 11 to 22 in d63051f
So the back arrow restores the LHN; the link below it doesn't. The two share the screen but use divergent exit routes.
What changes do you think we should make in order to solve the problem?
Mirror the back-button branch on the link in PageNotFoundFallback. When the policy is inaccessible (the deleted-workspace and similar cases), route the link through the same goBackFromWorkspaceSettingPages helper that already knows how to land the user back on the LHN-bearing tab:
return (
<NotFoundPage
shouldForceFullScreen={shouldShowFullScreenFallback}
shouldShowOfflineIndicator={false}
onBackButtonPress={() => {
if (isPolicyNotAccessible) {
goBackFromWorkspaceSettingPages();
return;
}
Navigation.goBack(policyID && !isMoneyRequest ? ROUTES.WORKSPACE_OVERVIEW.getRoute(policyID) : undefined);
}}
// eslint-disable-next-line react/jsx-props-no-spreading
{...fullPageNotFoundViewProps}
shouldShowBackButton={fullPageNotFoundViewProps?.shouldShowBackButton ?? (!shouldShowFullScreenFallback ? shouldUseNarrowLayout : undefined)}
KJ21-ENG commentedon May 13, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-05-13 14:24:02 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
After deleting a workspace, opening the copied workspace share URL shows the expected "Not here" page. Pressing "Go back to home page" should return the user to a normal app surface with the LHN/report list available, but it instead lands on the standalone Home tab where the report LHN is gone.
What is the root cause of that problem?
The video shows the clicked URL ending on
/workspaces/<policyID>/overview, which maps to the workspace profile/overview screen inside the workspace split navigator:App/src/libs/Navigation/linkingConfig/config.ts
Lines 2298 to 2303 in 8cbb4a6
App/src/libs/Navigation/AppNavigator/Navigators/WorkspaceSplitNavigator.tsx
Lines 17 to 18 in 8cbb4a6
WorkspaceOverviewPagerenders that route throughWorkspacePageWithSections:App/src/pages/workspace/WorkspaceOverviewPage.tsx
Lines 673 to 684 in 8cbb4a6
When the deleted workspace policy is empty/inaccessible,
WorkspacePageWithSectionssetsshouldShowfor the blocking NotFound view, and its back-button path already recovers withgoBackFromWorkspaceSettingPages():App/src/pages/workspace/WorkspacePageWithSections.tsx
Lines 168 to 182 in 8cbb4a6
App/src/libs/Navigation/helpers/goBackFromWorkspaceSettingPages.ts
Lines 11 to 21 in 8cbb4a6
But the NotFound link uses a different exit path: it calls
Navigation.goBackToHome()instead of the workspace NotFound recovery branch:App/src/pages/workspace/WorkspacePageWithSections.tsx
Lines 210 to 213 in 8cbb4a6
goBackToHome()now targetsROUTES.HOME:App/src/libs/Navigation/Navigation.ts
Lines 608 to 620 in 8cbb4a6
ROUTES.HOMEis the standalone Home tab, while the report LHN lives underNAVIGATORS.REPORTS_SPLIT_NAVIGATOR/SCREENS.INBOX:App/src/libs/Navigation/AppNavigator/Navigators/TabNavigator.tsx
Lines 115 to 122 in 8cbb4a6
App/src/libs/Navigation/linkingConfig/config.ts
Lines 2216 to 2228 in 8cbb4a6
So the overview NotFound page has two divergent exits: the back button returns to the LHN-capable workspace/inbox context, but the "Go back to home page" link sends the user to a tab that does not own the LHN.
What changes do you think we should make in order to solve the problem?
In
WorkspacePageWithSections, use the same workspace NotFound recovery path for the NotFound link that the back button already uses. The cleanest shape is to extract theshouldShowbranch fromhandleOnBackButtonPressinto a verb-named helper such asrecoverFromWorkspaceNotFound, callgoBackFromWorkspaceSettingPages()there, and pass that helper to bothFullPageNotFoundView.onBackButtonPressandFullPageNotFoundView.onLinkPresswhile the blocking workspace NotFound view is shown.Add a focused test for the workspace overview NotFound state: start from an Inbox/report split, navigate to a deleted/inaccessible
/workspaces/:policyID/overviewroute, press the NotFound link, and assert the app returns to the reports split/Inbox context instead ofSCREENS.HOME. The same test should cover the current back-button behavior so the two exits stay aligned.Scope boundaries: files touched should be
src/pages/workspace/WorkspacePageWithSections.tsxat the NotFound recovery/link callback plus a focused navigation or component test near the existing navigation/workspace tests. Platforms affected: all platforms via shared navigation, with the reproduced failure on Windows Chrome. Code paths not touched: globalNavigation.goBackToHome(), genericNotFoundPagefor unknown routes like/a/hello,FullPageNotFoundViewdefaults, workspace deletion API/Onyx data, and unrelated non-workspace NotFound screens. API/backend changes: none.What alternative solutions did you explore? (Optional)
My earlier draft targeted
WorkspaceInitialPage, but the reviewed media shows the reproduced URL is/workspaces/<policyID>/overview;WorkspaceInitialPageis the bare/workspaces/:policyIDroute and is not the screen shown in the failing video.A proposal that patches
AccessOrNotFoundWrappermirrors the right idea for workspace subpages that use that wrapper, but it does not fix the reproduced overview route becauseWorkspaceOverviewPagerenders its NotFound state throughWorkspacePageWithSections. A proposal that changesremoveScreenFromNavigationState()is also not the right boundary for this video path becauseWorkspacePageWithSectionsdoes not call that helper.Changing
goBackToHome()globally back toROUTES.INBOXwould restore the LHN here, but it would also undo the intentional generic NotFound behavior where unknown routes like/a/hellorecover to the Home tab. Keeping the fix in the workspace overview NotFound wrapper fixes the reported route without changing generic NotFound behavior.David-2002065 commentedon May 13, 2026
🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.
mukhrr commentedon May 13, 2026
Proposal
What is the root cause of that problem?
The "Go back to home page" link on the "Not here" page calls
Navigation.goBackToHome(), which was recently changed to navigate toROUTES.HOMEinstead ofROUTES.INBOX(commit 6c46ef3):App/src/libs/Navigation/Navigation.ts
Lines 608 to 621 in 9d65949
ROUTES.HOME(SCREENS.HOME) andROUTES.INBOX(SCREENS.INBOX) are two different sibling tabs insideTAB_NAVIGATOR. The LHN/reports list lives on the Inbox tab insideREPORTS_SPLIT_NAVIGATOR, whileSCREENS.HOMEis a standalone tab with no LHN at all:App/src/libs/Navigation/linkingConfig/config.ts
Lines 2216 to 2242 in 9d65949
So after a user lands on the "Not here" page for a deleted workspace and taps "Go back to home page",
goBackToHome()pops them onto the bareHometab — which has no LHN options — instead of back to theInboxtab where the LHN lives. That matches the reported symptom: "the page becomes stuck… hiding all LHN options".The previous behaviour (
goBack(ROUTES.INBOX)) was actually correct for this link: the "home page" the BlockingView refers to is the user's report list (the LHN). The rename made the function literal-name-correct but functionally wrong.What changes do you think we should make in order to solve the problem?
I'd revert the destination back to
ROUTES.INBOXso the link returns the user to the LHN, which is what every existing caller ofgoBackToHome()(workspace not-found, report not-found, generic 404, etc.) actually wants:function goBackToHome() { const isNarrowLayout = getIsNarrowLayout(); // This set the right split navigator. - goBack(ROUTES.HOME); + goBack(ROUTES.INBOX); // We want to keep the report screen in the split navigator on wide layout. if (!isNarrowLayout) { return; } // This set the right route in this split navigator. - goBack(ROUTES.HOME); + goBack(ROUTES.INBOX); }Since the earlier PR also deleted a workaround in
src/pages/ErrorPage/NotFoundPage.tsxfor the generic error screen (which explicitly wantedROUTES.HOME), we should restore that one branch so the generic 404 still lands on the Home tab while every contextual "Not here" (workspace deleted, report not accessible, etc.) lands back on the LHN:(plus re-adding the
useRoute()/isOnGenericErrorScreencheck that was removed alongside it).What alternative solutions did you explore? (Optional)
goBackToHome→goBackToInboxand keepROUTES.INBOX. Cleaner semantically, but it's a wider rename touching ~all call sites for no behaviour gain.SCREENS.HOMErender the LHN. That would mean restructuring the tab hierarchy so the "Home" tab embedsREPORTS_SPLIT_NAVIGATOR, which is a much larger refactor and changes the meaning of the new Home tab introduced by the recent navigation overhaul.ROUTES.HOME. This fixes the wording mismatch the original PR was trying to address, but still leaves the user on a tab without an LHN, so the actual user-visible bug ("LHN is lost") stays.Reverting the route is the smallest, lowest-risk fix that restores the intended UX.
melvin-bot commentedon May 13, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @jjcoffee (
External)[-]Workspace - LHN is lost when user navigate to deleted workspace link[/-][+][$250] Workspace - LHN is lost when user navigate to deleted workspace link[/+]melvin-bot commentedon May 13, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022054565237591329535
MobileMage commentedon May 13, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a user navigates to the URL of a deleted workspace, the "Not here" page is shown correctly. However, clicking "Go back to home page" leaves the user stuck — the LHN is no longer visible and no navigation is possible.
What is the root cause of that problem?
The root cause is in
AccessOrNotFoundWrapper, where two separate side effects fire simultaneously when a deleted workspace URL is visited.First, because
isPolicyNotAccessibleistrue,shouldShowNotFoundPageis set totrueandPageNotFoundFallbackrenders the "Not here" view. Its "Go back to home page" link callsNavigation.goBackToHome().Second, a
useEffectalso keyed onisPolicyNotAccessiblecallsNavigation.removeScreenFromNavigationState(SCREENS.WORKSPACE.INITIAL). This dispatchesCommonActions.reset()against the root navigator, stripping theWORKSPACE.INITIALroute out of the navigation stack. This reset happens before (or concurrently with) the user pressing "Go back to home page", leaving the navigation state in an inconsistent shape. WhengoBackToHome()then callsgoBack(ROUTES.HOME)it has no valid history to return to, so the navigator is effectively stuck and the LHN never re-renders.The key lines are:
App/src/pages/workspace/AccessOrNotFoundWrapper.tsx
Lines 201 to 206 in 9d65949
The
removeScreenFromNavigationStatecall was designed for a scenario where the user is already inside the workspace navigator and their access is revoked — it cleans up the INITIAL screen so the back stack collapses gracefully. But when the user arrives via a direct pasted URL (not from within the workspace navigator), the INITIAL screen may not even be on the stack, or removing it leaves the stack empty, which is what causes the broken state.What changes do you think we should make in order to solve the problem?
The
removeScreenFromNavigationState(SCREENS.WORKSPACE.INITIAL)call should be guarded so it only fires whenSCREENS.WORKSPACE.INITIALactually exists in the current root navigation state. Before dispatching the reset, check whether any route innavigationRef.getRootState().routescontains a workspace split navigator that hasWORKSPACE.INITIALas an active route. If the screen is not present (the user arrived via a direct link, not via the in-app workspace list), the effect should skip theremoveScreenFromNavigationStatecall entirely and instead delegate navigation togoBackFromWorkspaceSettingPages(), which already handles both the "came from inbox" and "came from workspaces list" cases correctly.Concretely, inside the
useEffectat lines 201-206 ofAccessOrNotFoundWrapper.tsx, add a check usingnavigationRef.getRootState()to determine whetherSCREENS.WORKSPACE.INITIALis actually present in the stack before callingremoveScreenFromNavigationState. If it is not present, callgoBackFromWorkspaceSettingPages()instead (or simply return early and let thePageNotFoundFallback's own back-button handler manage navigation). This ensures the navigation state is never reset to an empty/broken shape when the user arrives at a deleted workspace via a direct URL.App/src/libs/Navigation/helpers/goBackFromWorkspaceSettingPages.ts
Lines 11 to 22 in 9d65949
What alternative solutions did you explore? (Optional)
An alternative would be to fix
goBackToHome()to be more resilient when the navigation stack is empty or has fewer routes than expected — for example, by falling back to navigating toROUTES.HOMEviaNavigation.navigate()instead ofgoBack()when no valid back history exists. However, this treats a symptom rather than the cause: the navigation state should never be corrupted in the first place by a prematureresetthat removes a screen that is not there.35 remaining items
melvin-bot commentedon May 27, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.83-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-06-03. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon May 27, 2026
@jjcoffee The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
jjcoffee commentedon May 28, 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: Navigate to Home instead of Inbox in goBackToHome #88563 (comment)
Link to the comment on the Issue: [Due for payment 2026-05-07] [$250] Chat - Go back to home deeplink opens inbox #88443 (comment)
[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: N/A
[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/645141
Regression Test Proposal
Test:
Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-5446-aba5-d34e-a352e855a0e4melvin-bot commentedon Jun 2, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Jun 2, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon Jun 3, 2026
Payment Summary
Contributor+: @jjcoffee due $250 via NewDot
^ Test case created. Thx
twisterdotcom commentedon Jun 4, 2026
$250 approved for @jjcoffee in Report ID: R006sbsdGqAa.
Zapier Logs
Run ID: 00040eee-ba1b-a776-48f5-4d01ad20bd84SO: https://stackoverflowteams.com/c/expensify/questions/7582