Skip to content

[Due for payment 2026-06-03] [$250] Workspace - LHN is lost when user navigate to deleted workspace link #90520

Closed

Description

@lanitochka17

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: v9.3.73-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: https://test-management.browserstack.com/projects/2219752/test-runs/TR-28525/folder/13177080/41237957/1410969919?sort=%2Bstatus_id
Email or phone of affected tester (no customers): gocemate+b215490617@gmail.com
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: Windows 10/Chrome
App Component: Left Hand Navigation (LHN)

Action Performed:

  1. Create workspace
  2. Go to More> Share> Copy URL
  3. Go to More> Delete> Confirm the delete process
  4. Navigate to any chat and paste the workspace URL from step 2
  5. Verify Not here page opens
  6. Click on Go back to home page
  7. Try to navigate back to LHN menu

Expected Result:

LHN options should be displayed

Actual Result:

Page is stuck, user can not navigate back from Home page and LHN options are not displayed

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Bug7152612_1778660450149.Recording__696.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022054565237591329535
  • Upwork Job ID: 2054565237591329535
  • Last Price Increase: 2026-05-13
Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on May 13, 2026
  2. MelvinBot commented on May 13, 2026

    @MelvinBot
    Contributor

    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 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)

    1. 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().
    2. 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.

  3. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on May 13, 2026
  4. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on May 13, 2026
  5. yusufdeveloper2903 commented on May 13, 2026

    @yusufdeveloper2903
    Contributor

    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:

    function goBackToHome() {
    const isNarrowLayout = getIsNarrowLayout();
    // This set the right split navigator.
    goBack(ROUTES.HOME);
    // 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 is registered as a sibling tab to the Inbox inside TAB_NAVIGATOR, not its initial route:

    [NAVIGATORS.TAB_NAVIGATOR]: {
    initialRouteName: SCREENS.HOME,
    screens: {
    [SCREENS.HOME]: {
    path: ROUTES.HOME,
    exact: true,
    },
    [NAVIGATORS.REPORTS_SPLIT_NAVIGATOR]: {
    path: ROUTES.ROOT,
    screens: {
    [SCREENS.INBOX]: {
    path: ROUTES.INBOX,
    exact: true,
    },

    HomePage renders dashboard widgets only — no chat list and no LHN:

    function HomePage() {
    const {shouldUseNarrowLayout} = useResponsiveLayout();
    const styles = useThemeStyles();
    const {translate} = useLocalize();
    useDocumentTitle(translate('common.home'));
    const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP);
    const [isLoadingReportData = false] = useOnyx(ONYXKEYS.IS_LOADING_REPORT_DATA);
    const isForYouLoading = !!(isLoadingApp || isLoadingReportData);
    const receiptDropTargetRef = useRef<View>(null);
    // This hook signals that the app is ready to be opened after HomePage mounts
    // to make sure everything loads properly
    useConfirmReadyToOpenApp();
    return (
    <View style={styles.flex1}>
    <View
    ref={receiptDropTargetRef}
    style={styles.flex1}
    >
    <ScreenWrapper
    shouldEnablePickerAvoiding={false}
    shouldShowOfflineIndicatorInWideScreen
    testID="HomePage"
    enableEdgeToEdgeBottomSafeAreaPadding={false}
    bottomContent={<TabBarBottomContent selectedTab={NAVIGATION_TABS.HOME} />}
    bottomContentStyle={styles.overflowVisible}
    >
    <TopBar
    breadcrumbLabel={translate('common.home')}
    shouldShowLoadingBar={isForYouLoading}
    shouldDisplayHelpButton
    />
    <ScrollView
    contentContainerStyle={styles.homePageContentContainer}
    addBottomSafeAreaPadding
    >
    {!shouldUseNarrowLayout && <QuickCreationActionsBar />}
    <View style={styles.homePageMainLayout(shouldUseNarrowLayout)}>
    {/* Widgets handle their own visibility and may return null to avoid duplicating visibility logic here */}
    {shouldUseNarrowLayout ? (
    <>
    <FreeTrialSection />
    <TimeSensitiveSection />
    <GettingStartedSection />
    <ForYouSection />
    <UpcomingTravelSection />
    <AssignedCardsSection />
    <SpendOverTimeSection />
    <DiscoverSection />
    <AnnouncementSection />
    </>
    ) : (
    <>
    <View style={styles.homePageLeftColumn}>
    <TimeSensitiveSection />
    <ForYouSection />
    <SpendOverTimeSection />
    <DiscoverSection />
    </View>
    <View style={styles.homePageRightColumn}>
    <FreeTrialSection />
    <GettingStartedSection />
    <UpcomingTravelSection />
    <AssignedCardsSection />
    <AnnouncementSection />
    </View>
    </>
    )}
    </View>
    </ScrollView>
    </ScreenWrapper>
    </View>
    <ReceiptScanDropZone
    targetRef={receiptDropTargetRef}
    dropWrapperStyle={shouldUseNarrowLayout ? {marginBottom: variables.bottomTabHeight} : undefined}
    />
    </View>
    );
    }

    FullPageNotFoundView uses goBackToHome as the default link handler:

    onLinkPress = () => Navigation.goBackToHome(),

    NotFoundPage only sidesteps that default when the route is the generic SCREENS.NOT_FOUND:

    onLinkPress={isOnGenericErrorScreen ? () => Navigation.goBack(ROUTES.HOME) : fullPageNotFoundViewProps.onLinkPress}

    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:

    onBackButtonPress={() => {
    if (isPolicyNotAccessible) {
    goBackFromWorkspaceSettingPages();
    return;
    }
    Navigation.goBack(policyID && !isMoneyRequest ? ROUTES.WORKSPACE_OVERVIEW.getRoute(policyID) : undefined);
    }}

    …which dismisses back to the Inbox when the previous root route was REPORTS_SPLIT_NAVIGATOR, otherwise routes to the workspaces list:

    function goBackFromWorkspaceSettingPages() {
    const rootState = navigationRef.getRootState() as State<RootNavigatorParamList>;
    const secondToLastRoute = rootState.routes.at(-2);
    const isPreviousInbox = getActiveTabName(secondToLastRoute) === NAVIGATORS.REPORTS_SPLIT_NAVIGATOR;
    if (isPreviousInbox) {
    Navigation.dismissModal();
    } else {
    Navigation.goBack(ROUTES.WORKSPACES_LIST.route);
    }
    }

    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)}

    •     onLinkPress={isPolicyNotAccessible ? goBackFromWorkspaceSettingPages : fullPageNotFoundViewProps?.onLinkPress}
      />
      
      );
  6. KJ21-ENG commented on May 13, 2026

    @KJ21-ENG
    Contributor

    🚨 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:

    [NAVIGATORS.WORKSPACE_SPLIT_NAVIGATOR]: {
    screens: {
    [SCREENS.WORKSPACE.INITIAL]: {
    path: ROUTES.WORKSPACE_INITIAL.route,
    },
    [SCREENS.WORKSPACE.PROFILE]: ROUTES.WORKSPACE_OVERVIEW.route,

    const CENTRAL_PANE_WORKSPACE_SCREENS = {
    [SCREENS.WORKSPACE.PROFILE]: () => require<ReactComponentModule>('../../../../pages/workspace/WorkspaceOverviewPage').default,

    WorkspaceOverviewPage renders that route through WorkspacePageWithSections:

    return (
    <WorkspacePageWithSections
    headerText={translate('workspace.common.profile')}
    route={route}
    // 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():

    const shouldShow = useMemo(() => {
    // If the policy object doesn't exist or contains only error data, we shouldn't display it.
    if (((isEmptyObject(policy) || (Object.keys(policy).length === 1 && !isEmptyObject(policy.errors))) && isEmptyObject(policyDraft)) || shouldShowNotFoundPage) {
    return true;
    }
    // We check isPendingDelete and prevIsPendingDelete to prevent the NotFound view from showing right after we delete the workspace
    return (!isEmptyObject(policy) && !canEditWorkspaceSettings(policy) && !shouldShowNonAdmin) || (!shouldShowPolicy && !(isPendingDelete && !prevIsPendingDelete));
    // eslint-disable-next-line react-hooks/exhaustive-deps
    }, [policy, shouldShowNonAdmin, shouldShowPolicy]);
    const handleOnBackButtonPress = () => {
    if (shouldShow) {
    goBackFromWorkspaceSettingPages();
    return true;

    function goBackFromWorkspaceSettingPages() {
    const rootState = navigationRef.getRootState() as State<RootNavigatorParamList>;
    const secondToLastRoute = rootState.routes.at(-2);
    const isPreviousInbox = getActiveTabName(secondToLastRoute) === NAVIGATORS.REPORTS_SPLIT_NAVIGATOR;
    if (isPreviousInbox) {
    Navigation.dismissModal();
    } else {
    Navigation.goBack(ROUTES.WORKSPACES_LIST.route);
    }

    But the NotFound link uses a different exit path: it calls Navigation.goBackToHome() instead of the workspace NotFound recovery branch:

    <FullPageNotFoundView
    onBackButtonPress={handleOnBackButtonPress}
    onLinkPress={() => Navigation.goBackToHome()}
    shouldShow={shouldShow}

    goBackToHome() now targets ROUTES.HOME:

    function goBackToHome() {
    const isNarrowLayout = getIsNarrowLayout();
    // This set the right split navigator.
    goBack(ROUTES.HOME);
    // 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 is the standalone Home tab, while the report LHN lives under NAVIGATORS.REPORTS_SPLIT_NAVIGATOR / SCREENS.INBOX:

    <Tab.Screen
    name={SCREENS.HOME}
    component={HomePageScreen}
    />
    <Tab.Screen
    name={NAVIGATORS.REPORTS_SPLIT_NAVIGATOR}
    component={ReportsSplitNavigatorScreen}
    />

    [NAVIGATORS.TAB_NAVIGATOR]: {
    initialRouteName: SCREENS.HOME,
    screens: {
    [SCREENS.HOME]: {
    path: ROUTES.HOME,
    exact: true,
    },
    [NAVIGATORS.REPORTS_SPLIT_NAVIGATOR]: {
    path: ROUTES.ROOT,
    screens: {
    [SCREENS.INBOX]: {
    path: ROUTES.INBOX,
    exact: true,

    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.

  7. David-2002065 commented on May 13, 2026

    @David-2002065
    Contributor

    🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.

  8. mukhrr commented on May 13, 2026

    @mukhrr
    Contributor

    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 to ROUTES.HOME instead of ROUTES.INBOX (commit 6c46ef3):

    function goBackToHome() {
    const isNarrowLayout = getIsNarrowLayout();
    // This set the right split navigator.
    goBack(ROUTES.HOME);
    // 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:

    [NAVIGATORS.TAB_NAVIGATOR]: {
    initialRouteName: SCREENS.HOME,
    screens: {
    [SCREENS.HOME]: {
    path: ROUTES.HOME,
    exact: true,
    },
    [NAVIGATORS.REPORTS_SPLIT_NAVIGATOR]: {
    path: ROUTES.ROOT,
    screens: {
    [SCREENS.INBOX]: {
    path: ROUTES.INBOX,
    exact: true,
    },
    [SCREENS.REPORT]: {
    path: ROUTES.REPORT_WITH_ID.route,
    parse: {
    // eslint-disable-next-line
    reportID: (reportID: string | undefined) => reportID ?? '',
    },
    stringify: {
    // eslint-disable-next-line
    reportID: (reportID: string | undefined) => reportID ?? '',
    },
    },
    },
    },

    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:

    - onLinkPress={fullPageNotFoundViewProps.onLinkPress}
    + onLinkPress={isOnGenericErrorScreen ? () => Navigation.goBack(ROUTES.HOME) : fullPageNotFoundViewProps.onLinkPress}

    (plus re-adding the useRoute() / isOnGenericErrorScreen check that was removed alongside it).

    What alternative solutions did you explore? (Optional)

    1. Rename goBackToHome → goBackToInbox and keep ROUTES.INBOX. Cleaner semantically, but it's a wider rename touching ~all call sites for no behaviour gain.
    2. 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.
    3. 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.

  9. melvin-bot commented on May 13, 2026

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @jjcoffee (External)

  10. 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
  11. melvin-bot commented on May 13, 2026

    @melvin-bot
  12. MobileMage commented on May 13, 2026

    @MobileMage
    Contributor

    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 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 key lines are:

    useEffect(() => {
    if (isLoadingReportData || !isPolicyNotAccessible) {
    return;
    }
    Navigation.removeScreenFromNavigationState(SCREENS.WORKSPACE.INITIAL);
    }, [isLoadingReportData, isPolicyNotAccessible]);

    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.

    function goBackFromWorkspaceSettingPages() {
    const rootState = navigationRef.getRootState() as State<RootNavigatorParamList>;
    const secondToLastRoute = rootState.routes.at(-2);
    const isPreviousInbox = getActiveTabName(secondToLastRoute) === NAVIGATORS.REPORTS_SPLIT_NAVIGATOR;
    if (isPreviousInbox) {
    Navigation.dismissModal();
    } else {
    Navigation.goBack(ROUTES.WORKSPACES_LIST.route);
    }
    }

    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.

  13. 35 remaining items

  14. melvin-bot commented on May 27, 2026

    @melvin-bot

    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:

    • @jjcoffee requires payment through NewDot Manual Requests
  15. melvin-bot commented on May 27, 2026

    @melvin-bot

    @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]

  16. jjcoffee commented on May 28, 2026

    @jjcoffee
    Contributor

    BugZero Checklist:

    Regression Test Proposal

    Test:

    1. Create a workspace
    2. Go to More > Share > Copy URL
    3. Go to More > Delete > Confirm the delete process
    4. Navigate to Inbox and open any chat
    5. Paste the workspace URL from step 2
    6. Tap the link
    7. On the not found page click the go back to home link
    8. Verify you are returned to the home screen and can navigate to the LHN
    9. Open the chat from (5) and open the link again
    10. Click on back button on the not found page
    11. Verify that you are returned to the chat

    Do we agree 👍 or 👎

    Zapier Logs Run ID: 00040eee-5446-aba5-d34e-a352e855a0e4
  17. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on May 28, 2026
  18. melvin-bot commented on Jun 2, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  19. melvin-bot commented on Jun 2, 2026

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@mallenexpensify)

    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/2054565237591329535/hired)
    • I have verified the PR was not reverted
    • I have applied any discounts due to bugs/regressions introduced by this PR
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  20. mallenexpensify commented on Jun 3, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @jjcoffee due $250 via NewDot

    ^ Test case created. Thx

  21. twisterdotcom commented on Jun 4, 2026

    @twisterdotcom
    Contributor

    $250 approved for @jjcoffee in Report ID: R006sbsdGqAa.

    Zapier Logs Run ID: 00040eee-ba1b-a776-48f5-4d01ad20bd84

    SO: https://stackoverflowteams.com/c/expensify/questions/7582

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions