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 2025-07-01] [$250] Workspace - Unexpected Error in My Account After Deleting the Only Workspace #63948
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
Version Number: v9.1.64-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from TestRail:https://expensify.testrail.io/index.php?/tests/view/6197541 Email or phone of affected tester (no customers): na Issue reported by: Applause Internal Team Device used: Win11/chrome App Component: Workspace Settings
Action Performed:
Precondition : Create a new account without any Workspace
What changes do you think we should make in order to solve the problem?
We should navigate back to Settings profile page if the last visited settings route is subscription page and workspace is deleted when opening account tab.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None, Navigation issue
What alternative solutions did you explore? (Optional)
NA
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
🚨 Edited by proposal-police: This proposal was edited at 2025-06-11 10:53:24 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Workspace - Unexpected Error in My Account After Deleting the Only Workspace
What is the root cause of that problem?
On the Subscription page, if subscriptionPlan is false/undefined, we render a "not found" page. As a result, if the user no longer has any owned policy (i.e., they deleted their last workspace), accessing the Subscription page will show a "not found" error. From OP, after deleting the last workspace, the Subscription page remains as the last accessed settings page. Therefore, when the user clicks the Settings tab, the app attempts to open the Subscription page, which results in an error
functiongetLastVisitedSettingTabScreen(){constsettingsTabState=getSettingsTabStateFromSessionStorage();returnsettingsTabState?.routes?.at(-1)?.state?.routes?.at(-1)?.name;}...// We can consider excluding this for the narrow layout.if(shouldCalculateBillNewDot()){constlastAccessedSettingScreen=getLastVisitedSettingTabScreen();// <--- retrieving state from session storage// Note: Instead compare with screen name we can get the path from function above and compare like this lastAccessedSettingScreen.includes(ROUTES.SETTINGS_SUBSCRIPTION.route)if(lastAccessedSettingScreen&&lastAccessedSettingScreen===SCREENS.SETTINGS.SUBSCRIPTION.ROOT){saveSettingsTabPathToSessionStorage(ROUTES.SETTINGS_PROFILE.route);}}
...
=>API.write
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We can write a unit test for getTabStateFromSessionStorage by calling the delete workspace and then asserting that the url is updated as expected.
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
changed the title [-]Workspace - Unexpected Error in My Account After Deleting the Only Workspace[/-][+][$250] Workspace - Unexpected Error in My Account After Deleting the Only Workspace[/+]on Jun 11, 2025
changed the title [-][$250] Workspace - Unexpected Error in My Account After Deleting the Only Workspace[/-][+][Due for payment 2025-07-01] [$250] Workspace - Unexpected Error in My Account After Deleting the Only Workspace[/+]on Jun 24, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.70-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@ZhenjaHorbach@NicMendonca@ZhenjaHorbach 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]
[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: NA
[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.
Regression Test Proposal
Test:
Create new account
Create a workspace
Go to Accounts -> Subscription
Go to Workspace and delete the created Workspace
Go to Accounts
Verify that: We are navigated to Settings Profile Page
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
Activity
melvin-bot commentedon Jun 11, 2025
Triggered auto assignment to @NicMendonca (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.daledah commentedon Jun 11, 2025
🚨 Edited by proposal-police: This proposal was edited at 2025-06-11 10:24:05 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
After deleting the only Workspace, navigating to My Account > Subscriptions displays an error: "Hmm... it's not here."
What is the root cause of that problem?
After deleting the only workspace, when opening account tab we navigate to last visited route in accounts tab
App/src/components/Navigation/NavigationTabBar/index.tsx
Lines 129 to 133 in d27f7dc
And since the only workspace is deleted,
subscriptionPlanis cleared so Not found page is shownApp/src/pages/settings/Subscription/SubscriptionSettingsPage.tsx
Lines 41 to 43 in 7ef68bf
What changes do you think we should make in order to solve the problem?
We should navigate back to Settings profile page if the last visited settings route is subscription page and workspace is deleted when opening account tab.
Add after here
App/src/components/Navigation/NavigationTabBar/index.tsx
Line 129 in d27f7dc
Or we can check using state name instead of
Array.startsWith.What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None, Navigation issue
What alternative solutions did you explore? (Optional)
NA
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
linhvovan29546 commentedon Jun 11, 2025
🚨 Edited by proposal-police: This proposal was edited at 2025-06-11 10:53:24 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Workspace - Unexpected Error in My Account After Deleting the Only Workspace
What is the root cause of that problem?
On the Subscription page, if subscriptionPlan is false/undefined, we render a "not found" page. As a result, if the user no longer has any owned policy (i.e., they deleted their last workspace), accessing the Subscription page will show a "not found" error. From OP, after deleting the last workspace, the Subscription page remains as the last accessed settings page. Therefore, when the user clicks the Settings tab, the app attempts to open the Subscription page, which results in an error
App/src/pages/settings/Subscription/SubscriptionSettingsPage.tsx
Lines 41 to 43 in d27f7dc
What changes do you think we should make in order to solve the problem?
I think we can reset the last visited settings tab when the user deletes their last workspace
App/src/libs/actions/Policy/Policy.ts
Lines 469 to 470 in 7adf5b5
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We can write a unit test for
getTabStateFromSessionStorageby calling the delete workspace and then asserting that the url is updated as expected.What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
[-]Workspace - Unexpected Error in My Account After Deleting the Only Workspace[/-][+][$250] Workspace - Unexpected Error in My Account After Deleting the Only Workspace[/+]melvin-bot commentedon Jun 11, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021932850863780346928
melvin-bot commentedon Jun 11, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ZhenjaHorbach (
External)melvin-bot commentedon Jun 17, 2025
@ZhenjaHorbach Eep! 4 days overdue now. Issues have feelings too...
ZhenjaHorbach commentedon Jun 17, 2025
Not overdue
I will check today
10 remaining items
[-][$250] Workspace - Unexpected Error in My Account After Deleting the Only Workspace[/-][+][Due for payment 2025-07-01] [$250] Workspace - Unexpected Error in My Account After Deleting the Only Workspace[/+]melvin-bot commentedon Jun 24, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Jun 24, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.70-7 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 2025-07-01. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jun 24, 2025
@ZhenjaHorbach @NicMendonca @ZhenjaHorbach 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]
ZhenjaHorbach commentedon Jul 2, 2025
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: https://github.com/Expensify/App/pull/62344/files#r2179254348
[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: NA
[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.
Regression Test Proposal
Test:
Do we agree 👍 or 👎
NicMendonca commentedon Jul 2, 2025
Payment summary
Contributor: @daledah - $250 via Upwork (done ✅ )
Contributor+: @ZhenjaHorbach - $250 via NewDot
ZhenjaHorbach commentedon Jul 2, 2025
Requested in ND
garrettmknight commentedon Jul 21, 2025
$250 approved for @ZhenjaHorbach