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-07-13] [$250] [Web] Logged-out sign-in page URL shows /Home instead of root #94450
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:
Open New Expensify on web while logged out (or log out of an existing session).
Land on the sign-in page.
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:
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.
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 nameSCREENS.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.
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:
No authToken → AppNavigator renders PublicScreens.
PublicScreens mounts SignInPage as a root-level RootStack screen named Home.
Focused route name = Home; getPathFromState → RNGetPathFromState(state, config).
config.screens has no top-level Home entry → RN falls back to encodeURIComponent(route.name) → Home.
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.
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):
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:
Note the inbound direction already handles this exact case-sensitivity mismatch in getAdaptedStateFromPath — typing /Home is normalized back to / — but the outboundgetPathFromState 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:
constpath=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'/';}returnpath;
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.
🚨 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:
{/* 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.HOMEnested inside TAB_NAVIGATOR (ROUTES.HOME = 'home'). There is no top-level path for a route literally named Home:
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):
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:
functiongetPathFromState(state: State): string{constindex=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:
{/* 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)
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.
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.
Rename the public screen away from SCREENS.HOME — rejected: the shared name is deliberate (prevents sign-out animation/re-mount bugs).
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?
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.
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.
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.
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.
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?
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.
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.
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.
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:
{/* 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.Screenname={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):
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:
// 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)
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.
+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 ?? '';
...
}
+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)
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.
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.
Change ROUTES.HOME from 'home' to '' — rejected. Breaks the authenticated Home tab at /home and conflates two distinct screens (SignInPage vs HomePage).
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.
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:
@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]
[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 — 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.
Activity
sumo-slonik commentedon Jun 24, 2026
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.
MelvinBot commentedon Jun 24, 2026
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 registersSignInPageunder the screen nameSCREENS.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.HOMEto a path when nested insideTAB_NAVIGATOR(the authenticated tree), and it maps it to lowercaseROUTES.HOME = 'home'(config.ts:2165-2171). There is no top-level path mapping for a root-levelHomeroute.So when
getPathFromStateserializes the logged-out state, React Navigation can't find a path for the rootHomeroute 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) vsROUTES.HOME = 'home'(ROUTES.ts:1068) — case-mismatched pair.ROUTES.ROOT = ''(ROUTES.ts:43).Data flow:
authToken→AppNavigatorrendersPublicScreens.PublicScreensmountsSignInPageas a root-level RootStack screen namedHome.Home;getPathFromState→RNGetPathFromState(state, config).config.screenshas no top-levelHomeentry → RN falls back toencodeURIComponent(route.name)→Home./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 fromRNGetPathFromState(state, config), if the result is/Home(i.e. the focused route is the publicSCREENS.HOME), normalize it back to/. This mirrorsgetAdaptedStateFromPath.ts:417-421exactly and is the smallest, lowest-risk change.What alternative solutions did you explore? (Optional)
[SCREENS.HOME]: ROUTES.ROOTmapping inconfig.ts's top-levelscreens. This serializes the rootHomestate straight to/. More "correct" conceptually, but riskier:SCREENS.HOMEis already mapped nested underTAB_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.PublicScreens.tsx:27documents 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.
yusufdeveloper2903 commentedon Jun 24, 2026
Proposal
What is the root cause of that problem?
The sign-in page is registered in
PublicScreensunder the screen nameSCREENS.HOME('Home') with nopathmapping — it deliberately reuses theHOMEname so the public/authenticated structures stay aligned:App/src/libs/Navigation/AppNavigator/PublicScreens.tsx
Lines 27 to 37 in d34ce2d
The address bar URL is derived from the navigation state by our
getPathFromState. For a non-dynamic screen it just delegates to React Navigation'sRNGetPathFromState(state, config):App/src/libs/Navigation/helpers/getPathFromState.ts
Lines 147 to 156 in d34ce2d
The problem is that
configonly mapsSCREENS.HOMEnested insideNAVIGATORS.TAB_NAVIGATOR, as the lowercaseROUTES.HOME('home'):App/src/libs/Navigation/linkingConfig/config.ts
Lines 2165 to 2171 in d34ce2d
App/src/ROUTES.ts
Line 1068 in d34ce2d
When the user is logged out,
TAB_NAVIGATORdoes not exist in the navigator tree — the focused route isHomesitting at the root of the publicRootStack.RNGetPathFromStatefinds no config entry forHomeat that position (the onlyHomemapping is two levels deep, underTAB_NAVIGATOR, and is case-sensitively lowercasehome), 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 callsgetPathFromStateandhistory.replaceStates the result — native has no address bar:App/src/libs/Navigation/AppNavigator/createRootStackNavigator/syncBrowserHistory/index.web.ts
Lines 4 to 8 in d34ce2d
Note the inbound direction already handles this exact case-sensitivity mismatch in
getAdaptedStateFromPath— typing/Homeis normalized back to/— but the outboundgetPathFromStatehas no mirroring guard, so the state→URL conversion still emits/Home:App/src/libs/Navigation/helpers/getAdaptedStateFromPath.ts
Lines 417 to 421 in d34ce2d
So: logged-out focused route is the public
SCREENS.HOME(no path mapping at root) →RNGetPathFromStatefalls back to the literal route name →getPathFromStatereturns/Home→syncBrowserHistorywrites/Hometo 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 ingetAdaptedStateFromPath(permalink above); we apply the symmetric normalization at the single state→path convergence point so every consumer (most importantly the websyncBrowserHistory) benefits without touching call sites.In
getPathFromState(here), normalize the fallback result before returning:SCREENSis 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 forSCREENS.HOMEin the public linking config soRNGetPathFromStateresolves it natively. This is riskier:SCREENS.HOMEdoubles as the authenticated home tab, and introducing a secondHomepath entry at the root can collide with the existing nestedhomemapping and thegetAdaptedStateFromPathadaptation logic, affecting the authenticated flow. Normalizing the single fallback string ingetPathFromStateis narrower, keeps the public/auth structures untouched, and stays symmetric with the guard already present on the inbound path.ahmdshrif commentedon Jun 24, 2026
🚨 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:App/src/libs/Navigation/AppNavigator/PublicScreens.tsx
Lines 26 to 37 in d34ce2d
But the linking config only defines a
pathforSCREENS.HOMEnested insideTAB_NAVIGATOR(ROUTES.HOME = 'home'). There is no top-level path for a route literally namedHome:App/src/libs/Navigation/linkingConfig/config.ts
Lines 2165 to 2171 in d34ce2d
When logged out, the root navigation state is a single top-level route named
Home(not wrapped inTAB_NAVIGATOR).getPathFromStateis not a dynamic route, so it falls straight through to React Navigation'sRNGetPathFromState(state, config):App/src/libs/Navigation/helpers/getPathFromState.ts
Lines 147 to 156 in d34ce2d
React Navigation finds no top-level
pathforHome, 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 lowercasehomepath.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:App/src/libs/Navigation/helpers/getAdaptedStateFromPath.ts
Lines 412 to 420 in d34ce2d
Affected outbound call sites (all consume the same
getPathFromState, so one fix covers them):history.replaceState:App/src/libs/Navigation/AppNavigator/createRootStackNavigator/syncBrowserHistory/index.web.ts
Lines 4 to 8 in d34ce2d
App/src/libs/Navigation/NavigationRoot.tsx
Line 64 in d34ce2d
This also explains the web-only platform list: native
syncBrowserHistoryis 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:Regression safety: the authenticated root route is always
TAB_NAVIGATOR('TabNavigator'), neverHome, so keying on the root-level name leaves every logged-in URL (/,/home, reports, search) untouched:App/src/libs/Navigation/AppNavigator/AuthScreens.tsx
Lines 185 to 190 in d34ce2d
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 byREPORTS_SPLIT_NAVIGATOR, so a second''entry makesgetStateFromPath('')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)
SCREENS.HOME— rejected: collides with the existing''route used by reports and can break authenticated root deep-linking./Home— works but is brittle (depends on the rendered name/case); the structural name-check is cleaner and consistent with the inbound fix.SCREENS.HOME— rejected: the shared name is deliberate (prevents sign-out animation/re-mount bugs).aswin-s commentedon Jun 24, 2026
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
/Homeinstead 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, theTAB_NAVIGATORsetsinitialRouteName: SCREENS.HOME, andSCREENS.HOMEis assignedpath: ROUTES.HOMEwhich 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 byREPORTS_SPLIT_NAVIGATOR(a sibling screen insideTAB_NAVIGATOR), not bySCREENS.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?
src/libs/Navigation/linkingConfig/config.ts— ChangeSCREENS.HOME's path fromROUTES.HOME('home') to''(empty string / root), so that the sign-in screen is reachable at/rather than/home.src/libs/Navigation/linkingConfig/config.ts— EnsureREPORTS_SPLIT_NAVIGATOR's path (ROUTES.ROOT) does not conflict after theSCREENS.HOMEpath change; it may need to be given a non-root path or the two screens need distinct paths that don't collide.src/ROUTES.ts— IfROUTES.HOME('home') is no longer used as the linking path for the sign-in screen, audit other callers ofROUTES.HOMEto ensure no navigation references break.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.HOMEfrom'home'to''insrc/ROUTES.tsso the path fix propagates everywhereROUTES.HOMEis referenced, rather than overriding only in the linking config.melvin-bot commentedon Jun 24, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @nyomanjyotisa (
External)melvin-bot commentedon Jun 24, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022069730456820623719
[-][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[/+]godzillaxbox19982014-lgtm commentedon Jun 24, 2026
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:if):if (!SAMLUrl || hasOpenedAuthSession.current) {openAuthSessionAsync):openAuthSessionAsync(SAMLUrl, CONST.SAML_REDIRECT_URL)Footer):href: CONST.FOOTER.EXPENSIFY_APPROVED_URL,src/pages/signin/SAMLSignInPage/index.native.tsx:83andsrc/pages/signin/SAMLSignInPage/index.native.tsx:87do not agree on the same## Actual Result: The address bar shows, instead ofvalue, 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?
src/pages/signin/SAMLSignInPage/index.native.tsx:83to derive## Actual Result: The address bar shows, instead offrom the auth/onboarding state that owns this flow before the value is consumed.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.What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
tests/unit/Session*.tsfor the exact issue flow: [$250] [Web] Logged-out sign-in page URL shows /Home instead of root.src/pages/signin/SAMLSignInPage/index.native.tsx:83so valid existing## Actual Result: The address bar shows, instead ofbehavior still works.What alternative solutions did you explore? (Optional)
## Actual Result: The address bar shows, instead ofconsistent at the first read/write boundary shown above.neerajbachani commentedon Jun 24, 2026
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 browser URL is produced by
getPathFromState, which for non-dynamic screens delegates to React Navigation'sgetPathFromState(state, config):App/src/libs/Navigation/helpers/getPathFromState.ts(lines 147–156)But
configonly defines a path forSCREENS.HOMEnested insideTAB_NAVIGATOR(mapped to lowercase'home'):App/src/libs/Navigation/linkingConfig/config.ts(lines 2170–2175)When logged out,
TAB_NAVIGATORdoes not exist in the navigator tree — the focused root-stack route isHomesitting directly onPublicScreens.RNGetPathFromStatefinds no config entry for a root-levelHomeroute, 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)Data flow (logged out):
PublicScreensstate{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 aslinking.getPathFromState(primary web URL sync)App/src/libs/Navigation/AppNavigator/createRootStackNavigator/syncBrowserHistory/index.web.ts—history.replaceStateApp/src/libs/Navigation/NavigationRoot.tsx—updateLastVisitedPath(stores/Homein Onyx while on sign-in)Authenticated users are unaffected at the root level —
AuthScreensalways mountsTAB_NAVIGATORfirst, neverSCREENS.HOME:App/src/libs/Navigation/AppNavigator/AuthScreens.tsx(lines 186–190)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 isSCREENS.HOME— and return/before delegating toRNGetPathFromState.This is safer than a post-hoc string match on
/Homebecause it keys on navigation structure (only possible inPublicScreens) rather than React Navigation's fallback string format.App/src/libs/Navigation/helpers/getPathFromState.tsApp/tests/navigation/getPathFromStateTests.ts— add regression tests:What alternative solutions did you explore? (Optional)
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.Add a top-level
[SCREENS.HOME]: ROUTES.ROOTmapping inconfig.ts— rejected.ROUTES.ROOT('') is already used byREPORTS_SPLIT_NAVIGATORunderTAB_NAVIGATOR. A second empty-path entry at the top level would make/ambiguous for authenticated users (inbox vs sign-in).SCREENS.HOMEis also inFULL_SCREENS_SET, sogetAdaptedStatewould accept a bare{name: HOME}state without prependingTabNavigator.Change
ROUTES.HOMEfrom'home'to''— rejected. Breaks the authenticated Home tab at/homeand conflates two distinct screens (SignInPagevsHomePage).Rename the public screen away from
SCREENS.HOME— rejected. The shared name is deliberate (PublicScreens.tsxcomment) to prevent sign-out animation/re-mount bugs.23 remaining items
melvin-bot commentedon Jul 6, 2026
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:
melvin-bot commentedon Jul 6, 2026
@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]
melvin-bot commentedon Jul 9, 2026
@nyomanjyotisa Whoops! This issue is 2 days overdue. Let's get this updated quick!
melvin-bot commentedon Jul 10, 2026
Auto-assign attempt failed, all eligible assignees are OOO.
melvin-bot commentedon Jul 12, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
nyomanjyotisa commentedon Jul 13, 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: [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:
Test:
https://staging.new.expensify.com/./, not/Home.https://staging.new.expensify.com/Home./and the sign-in page remains displayed./, not/homeor/Home.Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-7ddb-a214-d0ea-6b785d68a844melvin-bot commentedon Jul 13, 2026
@mallenexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!
mallenexpensify commentedon Jul 15, 2026
Payment Summary
Contributor+: @nyomanjyotisa due $250 via NewDot
^ Test case created. Thx
trjExpensify commentedon Aug 3, 2026
approved $250 for @nyomanjyotisa