Skip to content

[Due for payment 2026-05-11] Workspace - Back button leads to Inbox tab from workspace overview page #88970

Closed

Description

@jponikarchuk

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.62-5
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #85234
Email or phone of affected tester (no customers): expensify416+da2@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Android
App Component: Other

Action Performed:

  1. Sign in with a new account (don't create workspace during onboarding)
  2. Go to Inbox > Tap on FAB button > Create Workspace > Tap Confirm
  3. Tap app back button

Expected Result:

User should be navigated back to workspace list page

Actual Result:

User is navigated back to inbox page

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Video.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Apr 27, 2026
  2. melvin-bot commented on Apr 27, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #85234

  3. melvin-bot commented on Apr 27, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  4. github-actions commented on Apr 27, 2026

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  5. OSBotify commented on Apr 27, 2026

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Frontend bug
    Causing PR: #85234 - "Introduce a Bottom Tab Navigator for Top-Level Navigation" by @WojtekBoman (High confidence)
    Related Issues: #85260

    Recommendation: REVERT

    The large navigation refactor in PR #85234 introduced a regression where the Android back button returns the user to the Inbox tab instead of the Workspaces list page after navigating to a workspace via the FAB + "Create Workspace" flow. This is a clear regression introduced by the PR itself — in fact, the PR's own QA test steps included a check for exactly this back-button behavior: "Switch to Workspaces tab, open a workspace, tap back — verify you return to Workspaces list (not Home)."

    Assigned: @WojtekBoman (PR author), @ZhenjaHorbach (approving reviewer), @mountiny (approving reviewer)
    Labels: DeployBlockerCash kept (Frontend bug in App). DeployBlocker is not present, so no label removal needed.

    Detailed Analysis

    Evidence

    • The bug is reproducible on staging (v9.3.62-5) but not production, confirming it was introduced in the current staging cycle.
    • melvin-bot already identified PR Introduce a Bottom Tab Navigator for Top-Level Navigation #85234 as the causing PR and assigned its author.
    • PR Introduce a Bottom Tab Navigator for Top-Level Navigation #85234 fundamentally restructured how top-level navigation works: it replaced individual root stack screens (REPORTS_SPLIT_NAVIGATOR, WORKSPACE_NAVIGATOR, etc.) with a real createBottomTabNavigator-based TAB_NAVIGATOR. All full-screen navigators now live as tab screens inside it.
    • The workspace creation flow (triggered from the FAB in Inbox) calls Navigation.navigate(routeToNavigate, {forceReplace: true}). After this navigation, when the user presses the Android back button, the navigation history context under the new tab navigator structure does not properly track that the user entered the workspace via the Workspaces tab — instead it falls back to the Inbox tab.
    • PR Introduce a Bottom Tab Navigator for Top-Level Navigation #85234 modified src/libs/Navigation/helpers/navigateToWorkspacesPage.ts, src/libs/actions/App.ts, src/pages/workspace/WorkspaceInitialPage.tsx, and the entire navigation hierarchy. The WorkspaceInitialPage back-button handler was updated as part of the PR to use shouldUseNarrowLayout && !route.params?.backTo ? Navigation.goBack() : Navigation.goBack(route.params?.backTo ?? ROUTES.WORKSPACES_LIST.route), but on narrow layout (Android), it calls the bare Navigation.goBack() which pops the workspace split — and under the new tab structure this can resolve to the Inbox tab rather than the workspace list.

    Verification

    • Affected files: src/pages/workspace/WorkspaceInitialPage.tsx, src/libs/Navigation/AppNavigator/Navigators/TabNavigator.native.tsx, src/libs/Navigation/helpers/linkTo/index.ts, src/libs/Navigation/AppNavigator/createRootStackNavigator/GetStateForActionHandlers.ts
    • All of these files are explicitly listed in the changed files for PR Introduce a Bottom Tab Navigator for Top-Level Navigation #85234, confirming direct modification by the causing PR.
    • The reproduction path is Android-only and narrow-layout specific, consistent with the shouldUseNarrowLayout branch in WorkspaceInitialPage.tsx that was changed in this PR.

    Root Cause

    PR #85234 replaced the old flat root-stack navigation model with a TAB_NAVIGATOR wrapping all tab screens. On narrow layout (Android), WorkspaceInitialPage calls Navigation.goBack() without a fallback route, relying on the navigation stack to resolve correctly. Under the old model, creating a workspace from Inbox would push the workspace screen onto a navigation stack that knew how to go back to the Workspaces tab. Under the new TAB_NAVIGATOR model, forceReplace navigation to the workspace route after creation replaces the history entry in a way that leaves the Inbox tab as the active context, so goBack() resolves to Inbox rather than the Workspaces list.

  6. MelvinBot commented on Apr 27, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    When creating a workspace from the FAB on the Inbox tab, createWorkspaceWithPolicyDraftAndNavigateToIt dismisses the RHP modal and then calls Navigation.navigate(routeToNavigate). This triggers linkTo, which checks if the target is in ROOT_TAB_SCREENS. Since WORKSPACE.INITIAL is in that set, isTargetAtTabRoot is true, so linkTo uses a NAVIGATE action (plain tab switch) instead of PUSH.

    The NAVIGATE action switches to the WORKSPACE_NAVIGATOR tab and passes nested params targeting WORKSPACE_SPLIT_NAVIGATOR. React Navigation's stack router creates the state with only the target screen — WORKSPACES_LIST is never injected into the back stack underneath. So when the Android back button is pressed, the WORKSPACE_NAVIGATOR stack has nothing to pop back to, the back action propagates to the tab navigator (which uses backBehavior="fullHistory"), and the user is returned to the previously active tab (Inbox).

    There is already a custom action OPEN_WORKSPACE_SPLIT that explicitly constructs the nested state as [WORKSPACES_LIST, WORKSPACE_SPLIT_NAVIGATOR], ensuring WORKSPACES_LIST is always in the back stack. However, the workspace creation flow does not use this action.

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

    In createWorkspaceWithPolicyDraftAndNavigateToIt, after dismissing the modal, dispatch the OPEN_WORKSPACE_SPLIT action (with the new policyID) instead of calling Navigation.navigate(). This reuses the existing handler that correctly builds the WORKSPACE_NAVIGATOR state with WORKSPACES_LIST underneath, so Android back navigates to the workspace list as expected.

    What alternative solutions did you explore?

    1. Modify linkTo to always PUSH when crossing tabs toward workspace screens — this would work but adds special-case logic to the general navigation path, and OPEN_WORKSPACE_SPLIT already solves this more cleanly.
    2. Modify the WorkspaceNavigator stack to always initialize with WORKSPACES_LIST — risky because it would affect all entries into the workspace tab, not just this flow.
    Investigation details

    Key code path:

    1. User taps FAB → Create Workspace → Confirm
    2. WorkspaceConfirmationPage calls createWorkspaceWithPolicyDraftAndNavigateToIt with routeToNavigate = ROUTES.WORKSPACE_INITIAL.getRoute(policyID) (on small screens)
    3. App.ts:636-639: Modal is dismissed, then Navigation.navigate(routeToNavigate) fires
    4. linkTo:188-189: isTargetAtTabRoot is true for WORKSPACE.INITIAL → NAVIGATE (tab switch) used, not PUSH
    5. Tab switches to WORKSPACE_NAVIGATOR, but stack state = [WORKSPACE_SPLIT_NAVIGATOR] only — no WORKSPACES_LIST
    6. Android back → nothing to pop → fullHistory back behavior → returns to Inbox

    Existing solution not used: OPEN_WORKSPACE_SPLIT handler explicitly constructs {routes: [WORKSPACES_LIST, WORKSPACE_SPLIT_NAVIGATOR], index: 1}.

    Related: getAdaptedStateFromPath also injects WORKSPACES_LIST as a safety net for deep links/URL restore, but linkTo uses getStateFromPath (React Navigation's default) and bypasses this logic.


    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.

  7. self-assigned this
    on Apr 27, 2026
  8. luacmartins commented on Apr 27, 2026

    @luacmartins
    Contributor

    @MelvinBot implement this

  9. 28 remaining items

  10. melvin-bot commented on May 5, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  11. added a commit that references this issue on May 6, 2026
  12. changed the title [-][Due for payment 2026-05-11] [Due for payment 2026-05-07] Workspace - Back button leads to Inbox tab from workspace overview page[/-] [+][Due for payment 2026-05-11] Workspace - Back button leads to Inbox tab from workspace overview page[/+] on May 7, 2026
  13. melvin-bot commented on May 8, 2026

    @melvin-bot

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

  14. dukenv0307 commented on May 9, 2026

    @dukenv0307
    Contributor

    not overdue

  15. melvin-bot commented on May 11, 2026

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@mallenexpensify)

    • (if NewFeature) I have created a PR for any necessary HelpDot updates, or I confirmed no updates are necessary.
    • 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//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
  16. mallenexpensify commented on May 12, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @dukenv0307 due $250 via NewDot

    ^ Test case created

  17. quinthar commented on May 21, 2026

    @quinthar
    Contributor

    Approved $250 to @dukenv0307

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.DailyKSv2Engineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions