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-05-22] [$250] The Workspaces tab does not restore the last workspace after refreshing. #89220
Version Number: 9.3.64-21 Reproducible in staging?: Y Reproducible in production?: N If this was caught during regression testing, add the test name, ID and link from BrowserStack: Email or phone of affected tester (no customers): Logs:https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by:@dmkt9 Slack conversation (hyperlinked to channel name): #Open source
Action Performed:
Open the application on desktop web.
Navigate to Workspaces > [Workspace name] > Categories.
Navigate to Home.
Refresh the application.
Navigate to Workspaces.
Expected Result:
The Categories view should remain displayed.
Actual Result:
The workspace list is displayed.
Workaround:
Unknown
Platforms:
Select the officially supported platforms where the issue was reproduced:
👋 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:
Identify the pull request that introduced this issue and revert it.
After a page refresh, the session storage fallback in useRestoreWorkspacesTabOnNavigate.ts:58-60 searches for WORKSPACE_NAVIGATOR at the root level of the state tree returned by getStateFromPath. But getStateFromPath returns a state rooted at TAB_NAVIGATOR (per the linking config hierarchy), with WORKSPACE_NAVIGATOR nested inside it. So the findLast call never finds WORKSPACE_NAVIGATOR and returns undefined, causing the function to fall through to the workspaces list.
The flow after refresh:
sessionStorage correctly holds /workspaces/{policyID}/categories (saved by NavigationRoot.tsx:82-83)
lastVisitedPath (Onyx) was overwritten to / when the user navigated to Home, so on refresh the app restores to Home — no workspace state in the live navigation tree
The hook correctly falls through to the session storage path at line 58
.routes?.findLast(r => r.name === WORKSPACE_NAVIGATOR) searches root routes and finds only TAB_NAVIGATOR — returns undefined
navigateToWorkspacesPage receives no lastWorkspacesTabNavigatorRoute and falls through to navigateToWorkspacesPage.ts:67: Navigation.navigate(ROUTES.WORKSPACES_LIST.route)
The existing test mocks getWorkspacesTabStateFromSessionStorage to return WORKSPACE_NAVIGATOR at the root level, which doesn't match the real getStateFromPath output — masking this bug.
What changes do you think we should make in order to solve the problem?
Update the test mock at line 285-304 to return the real getStateFromPath shape (with TAB_NAVIGATOR wrapping WORKSPACE_NAVIGATOR).
What alternative solutions did you explore? (Optional)
An alternative would be to change getWorkspacesTabStateFromSessionStorage() to return only the workspace-relevant portion of the state tree (unwrap TAB_NAVIGATOR before returning). This would keep the hook code simpler but would require changes to the utility function and any other callers.
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.
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Activity
github-actions commentedon Apr 29, 2026
👋 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:
melvin-bot commentedon Apr 29, 2026
Triggered auto assignment to @puneetlath (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.melvin-bot commentedon Apr 29, 2026
💬 A slack conversation has been started in #expensify-open-source
MelvinBot commentedon Apr 29, 2026
Proposal
What is the root cause of that problem?
After a page refresh, the session storage fallback in
useRestoreWorkspacesTabOnNavigate.ts:58-60searches forWORKSPACE_NAVIGATORat the root level of the state tree returned bygetStateFromPath. ButgetStateFromPathreturns a state rooted atTAB_NAVIGATOR(per the linking config hierarchy), withWORKSPACE_NAVIGATORnested inside it. So thefindLastcall never findsWORKSPACE_NAVIGATORand returnsundefined, causing the function to fall through to the workspaces list.The flow after refresh:
sessionStoragecorrectly holds/workspaces/{policyID}/categories(saved byNavigationRoot.tsx:82-83)lastVisitedPath(Onyx) was overwritten to/when the user navigated to Home, so on refresh the app restores to Home — no workspace state in the live navigation treegetWorkspacesTabStateFromSessionStorage()callsgetStateFromPath(path)which returns{routes: [{name: TAB_NAVIGATOR, state: {routes: [{name: WORKSPACE_NAVIGATOR, ...}]}}]}.routes?.findLast(r => r.name === WORKSPACE_NAVIGATOR)searches root routes and finds onlyTAB_NAVIGATOR— returnsundefinednavigateToWorkspacesPagereceives nolastWorkspacesTabNavigatorRouteand falls through tonavigateToWorkspacesPage.ts:67:Navigation.navigate(ROUTES.WORKSPACES_LIST.route)The existing test mocks
getWorkspacesTabStateFromSessionStorageto returnWORKSPACE_NAVIGATORat the root level, which doesn't match the realgetStateFromPathoutput — masking this bug.What changes do you think we should make in order to solve the problem?
In
useRestoreWorkspacesTabOnNavigate.ts:58-60, drill intoTAB_NAVIGATORbefore searching forWORKSPACE_NAVIGATOR:Update the test mock at line 285-304 to return the real
getStateFromPathshape (withTAB_NAVIGATORwrappingWORKSPACE_NAVIGATOR).What alternative solutions did you explore? (Optional)
An alternative would be to change
getWorkspacesTabStateFromSessionStorage()to return only the workspace-relevant portion of the state tree (unwrapTAB_NAVIGATORbefore returning). This would keep the hook code simpler but would require changes to the utility function and any other callers.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.arosiclair commentedon Apr 30, 2026
This is not so bad. Let's demote
35 remaining items
melvin-bot commentedon May 20, 2026
@sobitneupane Eep! 4 days overdue now. Issues have feelings too...
melvin-bot commentedon May 21, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon May 22, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon May 23, 2026
Payment Summary
Contributor+: @sobitneupane due $250 via NewDot
@sobitneupane plz complete the BZ checklist and tag me in a post once you have.
sobitneupane commentedon May 25, 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: [Payment due @ZhenjaHorbach] Add
NAVIGATORS.WORKSPACE_NAVIGATOR#86438 (comment)Link to the comment on the Issue: [$1500] Introduce a Bottom Tab Navigator for Top-Level Navigation #85260 (comment)
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue: https://github.com/Expensify/Expensify/issues/640695
Regression Test Proposal
Test:
Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-f757-a03b-00b9-204ca9180254sobitneupane commentedon May 25, 2026
@mallenexpensify
JmillsExpensify commentedon Jul 28, 2026
$250 approved for @sobitneupane