[Hold for #49539][$250] Android - Workspace - User is redirected to previous page when deleting current workspace
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: 9.0.57-0 Reproducible in staging?: Y Reproducible in production?: Y If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/5180087&group_by=cases:section_id&group_order=asc&group_id=296775 Issue reported by: Applause - Internal Team
Action Performed:
- Open the Expensify app
- Tap on the workspace selector on the top left corner
- Select any workspace
- Tap on settings on the bottom of the page
- Tap on "Workspaces"
- Tap on the three dots icon of the currently selected workspace and delete it
- Verify the app remains on the workspaces list page after the workspaces was deleted
Expected Result:
After deleting current workspace, user should remain on the workspaces list tab
Actual Result:
User is redirected to previous page instead of staying on workspaces list tab, after deleting currently selected workspace
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
- [x] Android: Standalone
- [x] Android: HybridApp
- [ ] Android: mWeb Chrome
- [ ] iOS: Standalone
- [ ] iOS: HybridApp
- [ ] iOS: mWeb Safari
- [ ] MacOS: Chrome / Safari
- [ ] MacOS: Desktop
Screenshots/Videos
Add any screenshot/video evidence
https://github.com/user-attachments/assets/7a619fbe-72c9-443a-ac5f-68336bf2243e
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~021853673909103643294
- Upwork Job ID: 1853673909103643294
- Last Price Increase: 2024-11-05
Triggered auto assignment to @Christinadobrzyn (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.
Edited by proposal-police: This proposal was edited at 2024-11-04 20:40:34 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
User is redirected to previous page when deleting current workspace
What is the root cause of that problem?
When user navigates to the workspace from the workspace selector then goes to the settings and delete this workspace the following condition is met:
https://github.com/Expensify/App/blob/af2d2c6fae67be99b97ccd619c9aa71821b5082f/src/pages/workspace/WorkspacesListPage.tsx#L136-L142 however we don't provide the route arg to the navigateWithSwitchPolicyID function which causes it to call the goBack in this case
What changes do you think we should make in order to solve the problem?
we should provide the workspace list page route to the navigateWithSwitchPolicyID function
Navigation.navigateWithSwitchPolicyID({policyID: undefined, route: ROUTES.SETTINGS_WORKSPACES});
or we can use the currentRoute instead of the hardcoded route.
What alternative solutions did you explore? (Optional)
Job added to Upwork: https://www.upwork.com/jobs/~021853673909103643294
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ntdiary (External)
this can be reproduced outside of the Hybrid app so adding External
Proposal
Please re-state the problem that we are trying to solve in this issue.
User is redirected to previous page instead of staying on workspaces list tab, after deleting currently selected workspace
What is the root cause of that problem?
We call navigateWithSwitchPolicyID without route param after we delete the active policy then it goes back to the previous page.
https://github.com/Expensify/App/blob/af2d2c6fae67be99b97ccd619c9aa71821b5082f/src/pages/workspace/WorkspacesListPage.tsx#L136-L142
What changes do you think we should make in order to solve the problem?
I don't think we need to navigate to another page because we've already been on the workspace list page. We can simply remove Navigation.navigateWithSwitchPolicyID({policyID: undefined}).
https://github.com/Expensify/App/blob/af2d2c6fae67be99b97ccd619c9aa71821b5082f/src/pages/workspace/WorkspacesListPage.tsx#L136-L142
What alternative solutions did you explore? (Optional)
Proposal
Please re-state the problem that we are trying to solve in this issue.
User is redirected to previous page when deleting current workspace
What is the root cause of that problem?
In this PR #38365, we added functionality mainly to display the allWorkspaceView after deleting the active workspace, and to show all chats when the user returns to the LHN. https://github.com/Expensify/App/blob/10454f06334ae3d07d4a28a81c5c79f3d2112c53/src/pages/workspace/WorkspacesListPage.tsx#L138-L141 https://github.com/Expensify/App/blob/10454f06334ae3d07d4a28a81c5c79f3d2112c53/src/pages/workspace/WorkspaceProfilePage.tsx#L137-L141
However, in this PR, we added navigation logic to BaseSidebarScreen.tsx, making the logic from the previous #38365 outdated.
https://github.com/Expensify/App/blob/10454f06334ae3d07d4a28a81c5c79f3d2112c53/src/pages/home/sidebar/SidebarScreen/BaseSidebarScreen.tsx#L44
What changes do you think we should make in order to solve the problem?
We can remove all the changes of this PR https://github.com/Expensify/App/pull/38365. For example
removing this code block https://github.com/Expensify/App/blob/10454f06334ae3d07d4a28a81c5c79f3d2112c53/src/pages/workspace/WorkspaceProfilePage.tsx#L137-L141
and this https://github.com/Expensify/App/blob/10454f06334ae3d07d4a28a81c5c79f3d2112c53/src/pages/workspace/WorkspacesListPage.tsx#L137-L141 https://github.com/Expensify/App/blob/10454f06334ae3d07d4a28a81c5c79f3d2112c53/src/pages/workspace/WorkspacesListPage.tsx#L116
and perform other cleanups from that PR.
Deleting workspace from workspace list view
https://github.com/user-attachments/assets/8452e865-2c15-402e-9b55-8cee578d20aa
Deleting workspace from workspace profile page
https://github.com/user-attachments/assets/e46e91b7-3497-49f0-bfa2-1f0b52a22535
What alternative solutions did you explore? (Optional)
@ntdiary can you take a peek at these proposals when you have a moment? Thank you!
@ntdiary can you take a peek at these proposals when you have a moment? Thank you!
@Christinadobrzyn, under review. 😄
Hey, @Christinadobrzyn, do you think this issue is urgent? if not, how about putting it on hold? Because we currently have a navigation refactoring plan, and I think it can address this issue as well. :)
I’ve reviewed the three proposals above, and their suggested changes may conflict a bit with our POC PR.
https://github.com/user-attachments/assets/d5ae6ca6-2185-42eb-a376-41bbd6f476f0
Oh yes, that sounds good - let's hold for 49539 and retest again
Hold for https://github.com/Expensify/App/pull/49539
Hold for https://github.com/Expensify/App/pull/49539
Hold for https://github.com/Expensify/App/pull/49539
Hold for https://github.com/Expensify/App/pull/49539
Hold for https://github.com/Expensify/App/pull/49539
Hold for https://github.com/Expensify/App/pull/49539
Hold for https://github.com/Expensify/App/pull/49539
Hold for https://github.com/Expensify/App/pull/49539
Hold for https://github.com/Expensify/App/pull/49539
Hold for https://github.com/Expensify/App/pull/49539
Hold for https://github.com/Expensify/App/pull/49539
Hold for https://github.com/Expensify/App/pull/49539
https://github.com/Expensify/App/pull/49539 is merged... I guess we need to retest. Moving to daily to test
#49539 is merged... I guess we need to retest. Moving to daily to test
@Christinadobrzyn, this issue has been fixed. :)
https://github.com/user-attachments/assets/161529e0-aabb-4230-820f-bacb53e0bd4e
Yay! Closing this out as complete.