App icon indicating copy to clipboard operation
App copied to clipboard

[Hold for #49539][$250] Android - Workspace - User is redirected to previous page when deleting current workspace

Open lanitochka17 opened this issue 1 year ago • 15 comments

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:

  1. Open the Expensify app
  2. Tap on the workspace selector on the top left corner
  3. Select any workspace
  4. Tap on settings on the bottom of the page
  5. Tap on "Workspaces"
  6. Tap on the three dots icon of the currently selected workspace and delete it
  7. 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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021853673909103643294
  • Upwork Job ID: 1853673909103643294
  • Last Price Increase: 2024-11-05

lanitochka17 avatar Nov 04 '24 20:11 lanitochka17

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.

melvin-bot[bot] avatar Nov 04 '24 20:11 melvin-bot[bot]

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)

abzokhattab avatar Nov 04 '24 20:11 abzokhattab

Job added to Upwork: https://www.upwork.com/jobs/~021853673909103643294

melvin-bot[bot] avatar Nov 05 '24 05:11 melvin-bot[bot]

Triggered auto assignment to Contributor-plus team member for initial proposal review - @ntdiary (External)

melvin-bot[bot] avatar Nov 05 '24 05:11 melvin-bot[bot]

this can be reproduced outside of the Hybrid app so adding External

Christinadobrzyn avatar Nov 05 '24 05:11 Christinadobrzyn

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)

mkzie2 avatar Nov 05 '24 06:11 mkzie2

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)

Nodebrute avatar Nov 05 '24 07:11 Nodebrute

@ntdiary can you take a peek at these proposals when you have a moment? Thank you!

Christinadobrzyn avatar Nov 06 '24 02:11 Christinadobrzyn

@ntdiary can you take a peek at these proposals when you have a moment? Thank you!

@Christinadobrzyn, under review. 😄

ntdiary avatar Nov 06 '24 02:11 ntdiary

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

https://github.com/user-attachments/assets/d5ae6ca6-2185-42eb-a376-41bbd6f476f0

ntdiary avatar Nov 06 '24 05:11 ntdiary

Oh yes, that sounds good - let's hold for 49539 and retest again

Christinadobrzyn avatar Nov 06 '24 06:11 Christinadobrzyn

Hold for https://github.com/Expensify/App/pull/49539

Christinadobrzyn avatar Nov 12 '24 01:11 Christinadobrzyn

Hold for https://github.com/Expensify/App/pull/49539

Christinadobrzyn avatar Nov 19 '24 05:11 Christinadobrzyn

Hold for https://github.com/Expensify/App/pull/49539

Christinadobrzyn avatar Dec 02 '24 22:12 Christinadobrzyn

Hold for https://github.com/Expensify/App/pull/49539

Christinadobrzyn avatar Dec 09 '24 23:12 Christinadobrzyn

Hold for https://github.com/Expensify/App/pull/49539

Christinadobrzyn avatar Dec 17 '24 17:12 Christinadobrzyn

Hold for https://github.com/Expensify/App/pull/49539

Christinadobrzyn avatar Dec 24 '24 22:12 Christinadobrzyn

Hold for https://github.com/Expensify/App/pull/49539

Christinadobrzyn avatar Jan 03 '25 23:01 Christinadobrzyn

Hold for https://github.com/Expensify/App/pull/49539

Christinadobrzyn avatar Jan 09 '25 14:01 Christinadobrzyn

Hold for https://github.com/Expensify/App/pull/49539

Christinadobrzyn avatar Jan 17 '25 15:01 Christinadobrzyn

Hold for https://github.com/Expensify/App/pull/49539

Christinadobrzyn avatar Jan 23 '25 02:01 Christinadobrzyn

Hold for https://github.com/Expensify/App/pull/49539

Christinadobrzyn avatar Jan 29 '25 00:01 Christinadobrzyn

Hold for https://github.com/Expensify/App/pull/49539

Christinadobrzyn avatar Feb 06 '25 01:02 Christinadobrzyn

https://github.com/Expensify/App/pull/49539 is merged... I guess we need to retest. Moving to daily to test

Christinadobrzyn avatar Feb 14 '25 19:02 Christinadobrzyn

#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

ntdiary avatar Feb 17 '25 07:02 ntdiary

Yay! Closing this out as complete.

Christinadobrzyn avatar Feb 19 '25 01:02 Christinadobrzyn