Skip to content

[Due for payment 2026-07-13] [$250] [Web] Logged-out sign-in page URL shows /Home instead of root #94450

Closed

Description

@sumo-slonik

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: 9.4.17-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: N/A
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by:
Slack conversation (hyperlinked to channel name):

Action Performed:

  1. Open New Expensify on web while logged out (or log out of an existing session).
  2. Land on the sign-in page.
  3. Look at the browser address bar.

Expected Result:

The logged-out sign-in page stays at the root URL /.

Actual Result:

The address bar shows /Home instead of / on the logged-out sign-in page.

Workaround:

Yes. The issue is cosmetic — the sign-in page renders and works normally; only the URL is wrong. Users can still sign in and use Expensify.

Platforms:

Select the officially supported platforms where the issue was reproduced:

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

Screenshots/Videos

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jun 24, 2026
  2. sumo-slonik commented on Jun 24, 2026

    @sumo-slonik
    ContributorAuthor

    Hi, I’m Kuba from SWM, and I already have an idea of how to fix this in line with the current assumptions of the application’s navigation architecture.

  3. MelvinBot commented on Jun 24, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    This is a URL-serialization bug (navigation state → URL), not a routing or rendering bug — the sign-in page renders fine, only the address bar is wrong.

    When logged out, the app mounts PublicScreens, which registers SignInPage under the screen name SCREENS.HOME ('Home') at the root of the RootStack (PublicScreens.tsx:27-37). The screen name is intentionally reused to mirror the authenticated structure.

    But the linking config only maps SCREENS.HOME to a path when nested inside TAB_NAVIGATOR (the authenticated tree), and it maps it to lowercase ROUTES.HOME = 'home' (config.ts:2165-2171). There is no top-level path mapping for a root-level Home route.

    So when getPathFromState serializes the logged-out state, React Navigation can't find a path for the root Home route and falls back to the literal route name → /Home, which is written to the address bar.

    The team already added the inbound half of this fix (/Home → / when parsing a path), and the code comment names this exact mismatch (getAdaptedStateFromPath.ts:417-421) — but the symmetric outbound normalization (state → URL) was never added, which is what fills the address bar.

    Evidence & data flow
    • SCREENS.HOME = 'Home' (SCREENS.ts:8) vs ROUTES.HOME = 'home' (ROUTES.ts:1068) — case-mismatched pair. ROUTES.ROOT = '' (ROUTES.ts:43).
    • Existing inbound-only fix, with the explanatory comment:
      // PublicScreens registers SCREENS.HOME ('Home') without a path mapping, so React Navigation derives `/Home` as the URL.
      // The authenticated config maps SCREENS.HOME to lowercase 'home', and the case-sensitive mismatch falls to NOT_FOUND.
      if (normalizedPath === `/${SCREENS.HOME}`) {
          normalizedPath = '/';
      }

    Data flow:

    1. No authToken → AppNavigator renders PublicScreens.
    2. PublicScreens mounts SignInPage as a root-level RootStack screen named Home.
    3. Focused route name = Home; getPathFromState → RNGetPathFromState(state, config).
    4. config.screens has no top-level Home entry → RN falls back to encodeURIComponent(route.name) → Home.
    5. Path /Home → history.replaceState({}, '', '/Home') (syncBrowserHistory/index.web.ts).

    This isolates the bug to serialization: the page renders correctly, only the URL is wrong.

    What changes do you think we should make in order to solve the problem?

    Add the outbound counterpart to the existing inbound fix, in getPathFromState.ts: after computing the path from RNGetPathFromState(state, config), if the result is /Home (i.e. the focused route is the public SCREENS.HOME), normalize it back to /. This mirrors getAdaptedStateFromPath.ts:417-421 exactly and is the smallest, lowest-risk change.

    What alternative solutions did you explore? (Optional)

    • Add a top-level [SCREENS.HOME]: ROUTES.ROOT mapping in config.ts's top-level screens. This serializes the root Home state straight to /. More "correct" conceptually, but riskier: SCREENS.HOME is already mapped nested under TAB_NAVIGATOR, so a second top-level mapping for the same screen name needs validation against the authenticated ↔ public sign-out transition to ensure no ambiguity.
    • Rename the public sign-in screen to a distinct name. Rejected — the comment at PublicScreens.tsx:27 documents that the structure must match the auth screens, and changing it risks sign-out animation regressions.

    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/94450) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.

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

    @yusufdeveloper2903
    Contributor

    Proposal

    What is the root cause of that problem?

    The sign-in page is registered in PublicScreens under the screen name SCREENS.HOME ('Home') with no path mapping — it deliberately reuses the HOME name so the public/authenticated structures stay aligned:

    {/* The structure for the HOME route has to be the same in public and auth screens. That's why the name for SignInPage is SCREENS.HOME. */}
    <RootStack.Screen
    name={SCREENS.HOME}
    options={{
    ...defaultScreenOptions,
    // If you want to change this, make sure there aren't any animation bugs when signing out.
    // This was put here to prevent excessive animations when resetting the navigation state in `resetNavigationState`
    animation: Animations.NONE,
    }}
    component={SignInPage}
    />

    The address bar URL is derived from the navigation state by our getPathFromState. For a non-dynamic screen it just delegates to React Navigation's RNGetPathFromState(state, config):

    function getPathFromState(state: State): string {
    const focusedRoute = findFocusedRoute(state);
    const screenName = focusedRoute?.name ?? '';
    if (isDynamicRouteScreen(screenName as Screen)) {
    return getPathFromStateWithDynamicRoute(state);
    }
    return RNGetPathFromState(state, config);
    }

    The problem is that config only maps SCREENS.HOME nested inside NAVIGATORS.TAB_NAVIGATOR, as the lowercase ROUTES.HOME ('home'):

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

    App/src/ROUTES.ts

    Line 1068 in d34ce2d

    HOME: 'home',

    When the user is logged out, TAB_NAVIGATOR does not exist in the navigator tree — the focused route is Home sitting at the root of the public RootStack. RNGetPathFromState finds no config entry for Home at that position (the only Home mapping is two levels deep, under TAB_NAVIGATOR, and is case-sensitively lowercase home), so it falls back to the literal route name and produces /Home.

    This only surfaces on web/mWeb because the address bar is written from this path by the web-only syncBrowserHistory, which calls getPathFromState and history.replaceStates the result — native has no address bar:

    function syncBrowserHistory(state: StackNavigationState<ParamListBase>) {
    // We reset the URL as the browser sets it in a way that doesn't match the navigation state
    // eslint-disable-next-line no-restricted-globals
    history.replaceState({}, '', getPathFromState(state));
    }

    Note the inbound direction already handles this exact case-sensitivity mismatch in getAdaptedStateFromPath — typing /Home is normalized back to / — but the outbound getPathFromState has no mirroring guard, so the state→URL conversion still emits /Home:

    // PublicScreens registers SCREENS.HOME ('Home') without a path mapping, so React Navigation derives `/Home` as the URL.
    // The authenticated config maps SCREENS.HOME to lowercase 'home', and the case-sensitive mismatch falls to NOT_FOUND.
    if (normalizedPath === `/${SCREENS.HOME}`) {
    normalizedPath = '/';
    }

    So: logged-out focused route is the public SCREENS.HOME (no path mapping at root) → RNGetPathFromState falls back to the literal route name → getPathFromState returns /Home → syncBrowserHistory writes /Home to the address bar.

    What changes do you think we should make in order to solve the problem?

    Mirror the existing inbound guard in the outbound getPathFromState. The canonical mapping /Home → / is already established in getAdaptedStateFromPath (permalink above); we apply the symmetric normalization at the single state→path convergence point so every consumer (most importantly the web syncBrowserHistory) benefits without touching call sites.

    In getPathFromState (here), normalize the fallback result before returning:

    const path = RNGetPathFromState(state, config);
    // PublicScreens registers SignInPage under SCREENS.HOME with no path mapping, so RNGetPathFromState
    // falls back to the literal route name and yields `/Home` while logged out. Normalize to root,
    // mirroring the inbound guard in getAdaptedStateFromPath.
    if (path === `/${SCREENS.HOME}`) {
        return '/';
    }
    return path;

    SCREENS is already imported in this file, so the guard is in scope and adds no new dependency. Minor changes/improvements can be discussed in the PR phase.

    What alternative solutions did you explore? (Optional)

    Add a root-level path: '/' mapping for SCREENS.HOME in the public linking config so RNGetPathFromState resolves it natively. This is riskier: SCREENS.HOME doubles as the authenticated home tab, and introducing a second Home path entry at the root can collide with the existing nested home mapping and the getAdaptedStateFromPath adaptation logic, affecting the authenticated flow. Normalizing the single fallback string in getPathFromState is narrower, keeps the public/auth structures untouched, and stays symmetric with the guard already present on the inbound path.

  7. ahmdshrif commented on Jun 24, 2026

    @ahmdshrif
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2026-06-24 10:33:35 UTC.

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    When logged out on web/mWeb, the sign-in page renders correctly but the address bar shows /Home (capital "H") instead of the root /. It is cosmetic — only the derived URL string is wrong.

    What is the root cause of that problem?

    The public sign-in page is intentionally registered under the route name SCREENS.HOME ('Home') so its navigator structure matches the authenticated side and avoids re-mount/animation glitches on sign-out:

    <RootStack.Navigator screenOptions={defaultScreenOptions}>
    {/* The structure for the HOME route has to be the same in public and auth screens. That's why the name for SignInPage is SCREENS.HOME. */}
    <RootStack.Screen
    name={SCREENS.HOME}
    options={{
    ...defaultScreenOptions,
    // If you want to change this, make sure there aren't any animation bugs when signing out.
    // This was put here to prevent excessive animations when resetting the navigation state in `resetNavigationState`
    animation: Animations.NONE,
    }}
    component={SignInPage}
    />

    But the linking config only defines a path for SCREENS.HOME nested inside TAB_NAVIGATOR (ROUTES.HOME = 'home'). There is no top-level path for a route literally named Home:

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

    When logged out, the root navigation state is a single top-level route named Home (not wrapped in TAB_NAVIGATOR). getPathFromState is not a dynamic route, so it falls straight through to React Navigation's RNGetPathFromState(state, config):

    function getPathFromState(state: State): string {
    const focusedRoute = findFocusedRoute(state);
    const screenName = focusedRoute?.name ?? '';
    if (isDynamicRouteScreen(screenName as Screen)) {
    return getPathFromStateWithDynamicRoute(state);
    }
    return RNGetPathFromState(state, config);
    }

    React Navigation finds no top-level path for Home, so it falls back to the raw screen name and encodes it → /Home. That is exactly why the symptom is the capitalized screen-name constant, not the lowercase home path.

    The team already knows this asymmetry: the inbound direction was patched to map /Home → /, but the outbound URL-generation direction was never given the symmetric fix:

    // Bing search results still link to /signin when searching for “Expensify”, but the /signin route no longer exists in our repo, so we redirect it to the home page to avoid showing a Not Found page.
    if (normalizedPath === CONST.SIGNIN_ROUTE) {
    normalizedPath = '/';
    }
    // PublicScreens registers SCREENS.HOME ('Home') without a path mapping, so React Navigation derives `/Home` as the URL.
    // The authenticated config maps SCREENS.HOME to lowercase 'home', and the case-sensitive mismatch falls to NOT_FOUND.
    if (normalizedPath === `/${SCREENS.HOME}`) {
    normalizedPath = '/';

    Affected outbound call sites (all consume the same getPathFromState, so one fix covers them):

    This also explains the web-only platform list: native syncBrowserHistory is a no-op (no address bar), so only web/mWeb show the wrong URL.

    What changes do you think we should make in order to solve the problem?

    Mirror the existing inbound special-case on the outbound side in getPathFromState. Detect the public Home route by its root-level route name and return root:

    function getPathFromState(state: State): string {
        const index = state.index ?? state.routes.length - 1;
        // Public sign-in is registered as SCREENS.HOME but has no top-level path,
        // so RN derives "/Home". Mirror the inbound getAdaptedStateFromPath fix.
        if (state.routes[index]?.name === SCREENS.HOME) {
            return `/${ROUTES.ROOT}`; // "/"
        }
        ...
    }

    Regression safety: the authenticated root route is always TAB_NAVIGATOR ('TabNavigator'), never Home, so keying on the root-level name leaves every logged-in URL (/, /home, reports, search) untouched:

    <RootStack.Navigator persistentScreens={[NAVIGATORS.TAB_NAVIGATOR, NAVIGATORS.RIGHT_MODAL_NAVIGATOR]}>
    {/* TAB_NAVIGATOR (containing Home and Workspaces) has to be the first navigator in auth screens. */}
    <RootStack.Screen
    name={NAVIGATORS.TAB_NAVIGATOR}
    options={getTabNavigatorOptions}
    getComponent={loadTabNavigator}

    Why the obvious one-liner is not enough: matching on the output string (if (basePath === '/Home') return '/') re-introduces the same case/format coupling the inbound workaround already suffers, and breaks the moment the screen name changes. Adding a top-level [SCREENS.HOME]: {path: ROUTES.ROOT} to the linking config is worse: ROUTES.ROOT ('') is already owned by REPORTS_SPLIT_NAVIGATOR, so a second '' entry makes getStateFromPath('') ambiguous and risks routing authenticated / to the wrong screen. Keying on the root route name avoids both traps.

    What alternative solutions did you explore? (Optional)

    1. Add an empty-path config entry for the public SCREENS.HOME — rejected: collides with the existing '' route used by reports and can break authenticated root deep-linking.
    2. Post-compute string match on /Home — works but is brittle (depends on the rendered name/case); the structural name-check is cleaner and consistent with the inbound fix.
    3. Rename the public screen away from SCREENS.HOME — rejected: the shared name is deliberate (prevents sign-out animation/re-mount bugs).
  8. aswin-s commented on Jun 24, 2026

    @aswin-s
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    When a user opens New Expensify on web while logged out (or after logging out), the browser address bar shows /Home instead of the expected root URL /. The sign-in page renders correctly and is fully functional, but the URL is wrong across all web platforms (Chrome, Safari, mWeb).

    What is the root cause of that problem?

    In src/libs/Navigation/linkingConfig/config.ts:2165–2171, the TAB_NAVIGATOR sets initialRouteName: SCREENS.HOME, and SCREENS.HOME is assigned path: ROUTES.HOME which resolves to the string 'home'. When unauthenticated users land on the app, React Navigation selects this initial route and serialises the path as /Home (case varies by platform) rather than /. The root path / is actually owned by REPORTS_SPLIT_NAVIGATOR (a sibling screen inside TAB_NAVIGATOR), not by SCREENS.HOME, so the sign-in screen is rendered under the wrong route and URL.

    What changes do you think we should make in order to solve the problem?

    1. src/libs/Navigation/linkingConfig/config.ts — Change SCREENS.HOME's path from ROUTES.HOME ('home') to '' (empty string / root), so that the sign-in screen is reachable at / rather than /home.
    2. src/libs/Navigation/linkingConfig/config.ts — Ensure REPORTS_SPLIT_NAVIGATOR's path (ROUTES.ROOT) does not conflict after the SCREENS.HOME path change; it may need to be given a non-root path or the two screens need distinct paths that don't collide.
    3. src/ROUTES.ts — If ROUTES.HOME ('home') is no longer used as the linking path for the sign-in screen, audit other callers of ROUTES.HOME to ensure no navigation references break.
    4. src/libs/Navigation/helpers/getStateToResetAfterLogout.ts — Verify the fallback reset {index: 0, routes: [{name: SCREENS.HOME}]} still resolves to / after the path fix; no code change needed if the linking config fix is sufficient.

    What alternative solutions did you explore? (Optional)

    Alternatively, rename ROUTES.HOME from 'home' to '' in src/ROUTES.ts so the path fix propagates everywhere ROUTES.HOME is referenced, rather than overriding only in the linking config.

  9. melvin-bot commented on Jun 24, 2026

    @melvin-bot

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

  10. melvin-bot commented on Jun 24, 2026

    @melvin-bot
  11. changed the title [-][Web] Logged-out sign-in page URL shows /Home instead of root[/-] [+][$250] [Web] Logged-out sign-in page URL shows /Home instead of root[/+] on Jun 24, 2026
  12. godzillaxbox19982014-lgtm commented on Jun 24, 2026

    @godzillaxbox19982014-lgtm

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    [$250] [Web] Logged-out sign-in page URL shows /Home instead of root

    What is the root cause of that problem?

    I traced this to the path that handles ## Actual Result: The address bar shows, instead of:

    • src/pages/signin/SAMLSignInPage/index.native.tsx:83 (if): if (!SAMLUrl || hasOpenedAuthSession.current) {
    • src/pages/signin/SAMLSignInPage/index.native.tsx:87 (openAuthSessionAsync): openAuthSessionAsync(SAMLUrl, CONST.SAML_REDIRECT_URL)
    • src/pages/signin/SignInPageLayout/Footer.tsx:75 (Footer): href: CONST.FOOTER.EXPENSIFY_APPROVED_URL,
    • The local evidence matches this recurring failure shape: domain/account lookup errors are mapped to generic failure text. Here, src/pages/signin/SAMLSignInPage/index.native.tsx:83 and src/pages/signin/SAMLSignInPage/index.native.tsx:87 do not agree on the same ## Actual Result: The address bar shows, instead of value, so the user-visible path can show a missing or stale state even though nearby data already has the needed context.

    What changes do you think we should make in order to solve the problem?

    • Update src/pages/signin/SAMLSignInPage/index.native.tsx:83 to derive ## Actual Result: The address bar shows, instead of from the auth/onboarding state that owns this flow before the value is consumed.
    • Carry the same normalized value through src/pages/signin/SAMLSignInPage/index.native.tsx:87; that follows the safer family move to map the API error to the user-facing translation at the action boundary, so the write/optimistic/read paths agree instead of only changing the visible component.
    • Keep the change inside the Auth, Login, Onboarding, Account Details surface and avoid changing account/login flows, auth tokens.

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    1. Add or update a regression in tests/unit/Session*.ts for the exact issue flow: [$250] [Web] Logged-out sign-in page URL shows /Home instead of root.
    2. Cover the counter-case near src/pages/signin/SAMLSignInPage/index.native.tsx:83 so valid existing ## Actual Result: The address bar shows, instead of behavior still works.
    3. Manually repeat the issue steps after the patch and confirm the visible state/action is no longer stale.

    What alternative solutions did you explore? (Optional)

    • I would not add a broad new condition outside these referenced paths; the safer fix is to keep ## Actual Result: The address bar shows, instead of consistent at the first read/write boundary shown above.
  13. neerajbachani commented on Jun 24, 2026

    @neerajbachani
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    When a user opens New Expensify on web while logged out (or after logging out), the sign-in page renders correctly but the browser address bar shows /Home (capital "H") instead of the expected root URL /. The issue is cosmetic — only the derived URL string is wrong — but it affects all web platforms (Chrome, Safari, mWeb).

    What is the root cause of that problem?

    The public sign-in page is intentionally registered under the route name SCREENS.HOME ('Home') at the root of the public stack so its navigator structure matches the authenticated side and avoids re-mount/animation glitches on sign-out:

    App/src/libs/Navigation/AppNavigator/PublicScreens.tsx (lines 27–37)

    {/* The structure for the HOME route has to be the same in public and auth screens. That's why the name for SignInPage is SCREENS.HOME. */}
    <RootStack.Screen
        name={SCREENS.HOME}
        options={{
            ...defaultScreenOptions,
            animation: Animations.NONE,
        }}
        component={SignInPage}
    />

    The browser URL is produced by getPathFromState, which for non-dynamic screens delegates to React Navigation's getPathFromState(state, config):

    App/src/libs/Navigation/helpers/getPathFromState.ts (lines 147–156)

    function getPathFromState(state: State): string {
        const focusedRoute = findFocusedRoute(state);
        const screenName = focusedRoute?.name ?? '';
    
        if (isDynamicRouteScreen(screenName as Screen)) {
            return getPathFromStateWithDynamicRoute(state);
        }
    
        return RNGetPathFromState(state, config);
    }

    But config only defines a path for SCREENS.HOME nested inside TAB_NAVIGATOR (mapped to lowercase 'home'):

    App/src/libs/Navigation/linkingConfig/config.ts (lines 2170–2175)

    [NAVIGATORS.TAB_NAVIGATOR]: {
        initialRouteName: SCREENS.HOME,
        screens: {
            [SCREENS.HOME]: {
                path: ROUTES.HOME, // 'home'
                exact: true,
            },

    When logged out, TAB_NAVIGATOR does not exist in the navigator tree — the focused root-stack route is Home sitting directly on PublicScreens. RNGetPathFromState finds no config entry for a root-level Home route, falls back to the literal screen name, and emits /Home.

    This is a URL-serialization bug (navigation state → URL), not a routing or rendering bug. The inbound direction was already patched in #89737, but the outbound direction was never given the symmetric fix:

    App/src/libs/Navigation/helpers/getAdaptedStateFromPath.ts (lines 416–420)

    // PublicScreens registers SCREENS.HOME ('Home') without a path mapping, so React Navigation derives `/Home` as the URL.
    // The authenticated config maps SCREENS.HOME to lowercase 'home', and the case-sensitive mismatch falls to NOT_FOUND.
    if (normalizedPath === `/${SCREENS.HOME}`) {
        normalizedPath = '/';
    }

    Data flow (logged out):

    PublicScreens state {routes: [{name: 'Home'}], index: 0} → getPathFromState → RNGetPathFromState (no root mapping) → /Home → linkingConfig.getPathFromState / syncBrowserHistory → address bar shows /Home.

    Affected outbound call sites (all consume the same getPathFromState, so one fix covers them):

    • App/src/libs/Navigation/linkingConfig/index.ts — registered as linking.getPathFromState (primary web URL sync)
    • App/src/libs/Navigation/AppNavigator/createRootStackNavigator/syncBrowserHistory/index.web.ts — history.replaceState
    • App/src/libs/Navigation/NavigationRoot.tsx — updateLastVisitedPath (stores /Home in Onyx while on sign-in)

    Authenticated users are unaffected at the root level — AuthScreens always mounts TAB_NAVIGATOR first, never SCREENS.HOME:

    App/src/libs/Navigation/AppNavigator/AuthScreens.tsx (lines 186–190)

    <RootStack.Navigator persistentScreens={[NAVIGATORS.TAB_NAVIGATOR, NAVIGATORS.RIGHT_MODAL_NAVIGATOR]}>
        <RootStack.Screen
            name={NAVIGATORS.TAB_NAVIGATOR}
            ...
        />

    What changes do you think we should make in order to solve the problem?

    Add the symmetric outbound counterpart to the existing inbound guard in getPathFromState. Detect the public sign-in state structurally — when the root-stack focused route is SCREENS.HOME — and return / before delegating to RNGetPathFromState.

    This is safer than a post-hoc string match on /Home because it keys on navigation structure (only possible in PublicScreens) rather than React Navigation's fallback string format.

    App/src/libs/Navigation/helpers/getPathFromState.ts

    +import SCREENS from '@src/SCREENS';
    
     function getPathFromState(state: State): string {
    +    const rootIndex = state.index ?? state.routes.length - 1;
    +    const rootRoute = state.routes[rootIndex];
    +
    +    // PublicScreens registers SignInPage as SCREENS.HOME at the root stack with no linking path,
    +    // so RNGetPathFromState falls back to the literal screen name (/Home). Authenticated users
    +    // always have TAB_NAVIGATOR at the root, so this only matches the public sign-in state.
    +    // Mirrors the inbound guard in getAdaptedStateFromPath.ts.
    +    if (rootRoute?.name === SCREENS.HOME) {
    +        return '/';
    +    }
    +
         const focusedRoute = findFocusedRoute(state);
         const screenName = focusedRoute?.name ?? '';
         ...
     }

    App/tests/navigation/getPathFromStateTests.ts — add regression tests:

    +describe('public sign-in URL', () => {
    +    it('should return / for root-level SCREENS.HOME (public SignInPage)', () => {
    +        const state = {routes: [{name: SCREENS.HOME}], index: 0};
    +        mockRNGetPathFromState.mockReturnValue('/Home');
    +
    +        expect(getPathFromState(state)).toBe('/');
    +        expect(mockRNGetPathFromState).not.toHaveBeenCalled();
    +    });
    +
    +    it('should not affect authenticated Home tab at /home', () => {
    +        const state = {routes: [{name: NAVIGATORS.TAB_NAVIGATOR, state: {routes: [{name: SCREENS.HOME}], index: 0}}], index: 0};
    +        mockRNGetPathFromState.mockReturnValue('/home');
    +
    +        expect(getPathFromState(state)).toBe('/home');
    +    });
    +
    +    it('should not force / when test tools modal is focused over sign-in', () => {
    +        const state = {routes: [{name: SCREENS.HOME}, {name: NAVIGATORS.TEST_TOOLS_MODAL_NAVIGATOR, state: {...}}], index: 1};
    +        mockRNGetPathFromState.mockReturnValue('/test-tools-path');
    +
    +        expect(getPathFromState(state)).toBe('/test-tools-path');
    +    });
    +});

    What alternative solutions did you explore? (Optional)

    1. Post-hoc string match (if (path === '/Home') return '/') — works and mirrors the inbound guard, but is brittle: it couples to React Navigation's fallback format rather than the actual navigation state, and would not generalize if the fallback format ever changed.

    2. Add a top-level [SCREENS.HOME]: ROUTES.ROOT mapping in config.ts — rejected. ROUTES.ROOT ('') is already used by REPORTS_SPLIT_NAVIGATOR under TAB_NAVIGATOR. A second empty-path entry at the top level would make / ambiguous for authenticated users (inbox vs sign-in). SCREENS.HOME is also in FULL_SCREENS_SET, so getAdaptedState would accept a bare {name: HOME} state without prepending TabNavigator.

    3. Change ROUTES.HOME from 'home' to '' — rejected. Breaks the authenticated Home tab at /home and conflates two distinct screens (SignInPage vs HomePage).

    4. Rename the public screen away from SCREENS.HOME — rejected. The shared name is deliberate (PublicScreens.tsx comment) to prevent sign-out animation/re-mount bugs.

  14. 23 remaining items

  15. melvin-bot commented on Jul 6, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.27-2 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-07-13. 🎊

    For reference, here are some details about the assignees on this issue:

  16. melvin-bot commented on Jul 6, 2026

    @melvin-bot

    @nyomanjyotisa 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]. If no checklist is needed for this issue, you can click: [no checklist button]

  17. melvin-bot commented on Jul 9, 2026

    @melvin-bot

    @nyomanjyotisa Whoops! This issue is 2 days overdue. Let's get this updated quick!

  18. melvin-bot commented on Jul 10, 2026

    @melvin-bot

    Auto-assign attempt failed, all eligible assignees are OOO.

  19. melvin-bot commented on Jul 12, 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/2069730456820623719/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. nyomanjyotisa commented on Jul 13, 2026

    @nyomanjyotisa
    Member

    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: [Home Page] Remove Beta Gate for Release 1 #80965 (comment)
      Link to the comment on the Issue: [Home Page] Remove Beta Gate for Release 1 #80139 (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 — this was a non-critical cosmetic regression and sign-in continued to work.

    • [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/659833

    Regression Test Proposal

    Precondition:

    • Have a valid staging account.
    • Copy the URL of a chat accessible by that account, then sign out.

    Test:

    1. On desktop web, open https://staging.new.expensify.com/.
    2. Verify the sign-in page is displayed and the URL path is /, not /Home.
    3. Navigate directly to https://staging.new.expensify.com/Home.
    4. Verify it redirects to / and the sign-in page remains displayed.
    5. Sign in, navigate to the Home tab, and sign out.
    6. Verify the sign-in page is displayed and the URL path is /, not /home or /Home.
    7. While signed out, open the copied chat URL and sign in.
    8. Verify the copied chat opens after signing in.
    9. Repeat steps 1–6 on mobile web.

    Do we agree 👍 or 👎

    Zapier Logs Run ID: 00040eee-7ddb-a214-d0ea-6b785d68a844
  21. melvin-bot commented on Jul 13, 2026

    @melvin-bot

    @mallenexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!

  22. mallenexpensify commented on Jul 15, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @nyomanjyotisa due $250 via NewDot

    ^ Test case created. Thx

  23. trjExpensify commented on Aug 3, 2026

    @trjExpensify
    Contributor

    approved $250 for @nyomanjyotisa

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

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions