Skip to content

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

Closed

Description

@lanitochka17

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: 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?

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Bug6654657_1730748744993.Delete_WS.mp4

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

Activity

  1. added
    Daily
    Bug
    on Nov 4, 2024
  2. melvin-bot commented on Nov 4, 2024

    @melvin-bot

    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.

  3. abzokhattab commented on Nov 4, 2024

    @abzokhattab
    Contributor

    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:

    // If the workspace being deleted is the active workspace, switch to the "All Workspaces" view
    if (activeWorkspaceID === policyIDToDelete) {
    setActiveWorkspaceID(undefined);
    Navigation.navigateWithSwitchPolicyID({policyID: undefined});
    }
    };
    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)

  4. added
    External
    on Nov 5, 2024
  5. changed the title [-]Android - Workspace - User is redirected to previous page when deleting current workspace[/-] [+][$250] Android - Workspace - User is redirected to previous page when deleting current workspace[/+] on Nov 5, 2024
  6. melvin-bot commented on Nov 5, 2024

    @melvin-bot
  7. added
    Help Wanted
    on Nov 5, 2024
  8. melvin-bot commented on Nov 5, 2024

    @melvin-bot

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

  9. Christinadobrzyn commented on Nov 5, 2024

    @Christinadobrzyn
    Contributor

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

  10. mkzie2 commented on Nov 5, 2024

    @mkzie2
    Contributor

    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.

    // If the workspace being deleted is the active workspace, switch to the "All Workspaces" view
    if (activeWorkspaceID === policyIDToDelete) {
    setActiveWorkspaceID(undefined);
    Navigation.navigateWithSwitchPolicyID({policyID: undefined});
    }
    };

    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}).

    // If the workspace being deleted is the active workspace, switch to the "All Workspaces" view
    if (activeWorkspaceID === policyIDToDelete) {
    setActiveWorkspaceID(undefined);
    Navigation.navigateWithSwitchPolicyID({policyID: undefined});
    }
    };

    What alternative solutions did you explore? (Optional)

  11. Nodebrute commented on Nov 5, 2024

    @Nodebrute
    Contributor

    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.

    if (activeWorkspaceID === policyIDToDelete) {
    setActiveWorkspaceID(undefined);
    Navigation.navigateWithSwitchPolicyID({policyID: undefined});
    }

    // If the workspace being deleted is the active workspace, switch to the "All Workspaces" view
    if (activeWorkspaceID === policy?.id) {
    setActiveWorkspaceID(undefined);
    Navigation.navigateWithSwitchPolicyID({policyID: undefined});
    }

    However, in this PR, we added navigation logic to BaseSidebarScreen.tsx, making the logic from the previous #38365 outdated.

    Navigation.navigateWithSwitchPolicyID({policyID: undefined});

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

    We can remove all the changes of this PR #38365. For example

    removing this code block

    // If the workspace being deleted is the active workspace, switch to the "All Workspaces" view
    if (activeWorkspaceID === policy?.id) {
    setActiveWorkspaceID(undefined);
    Navigation.navigateWithSwitchPolicyID({policyID: undefined});
    }

    and this

    // If the workspace being deleted is the active workspace, switch to the "All Workspaces" view
    if (activeWorkspaceID === policyIDToDelete) {
    setActiveWorkspaceID(undefined);
    Navigation.navigateWithSwitchPolicyID({policyID: undefined});
    }

    const {activeWorkspaceID, setActiveWorkspaceID} = useActiveWorkspace();

    and perform other cleanups from that PR.

    Deleting workspace from workspace list view

    Screen.Recording.2024-11-05.at.12.06.31.PM.mov

    Deleting workspace from workspace profile page

    Screen.Recording.2024-11-05.at.12.00.55.PM.mov

    What alternative solutions did you explore? (Optional)

  12. Christinadobrzyn commented on Nov 6, 2024

    @Christinadobrzyn
    Contributor

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

  13. 19 remaining items

  14. Christinadobrzyn commented on Jan 3, 2025

    @Christinadobrzyn
    Contributor

    Hold for #49539

  15. Christinadobrzyn commented on Jan 9, 2025

    @Christinadobrzyn
    Contributor

    Hold for #49539

  16. Christinadobrzyn commented on Jan 17, 2025

    @Christinadobrzyn
    Contributor

    Hold for #49539

  17. Christinadobrzyn commented on Jan 23, 2025

    @Christinadobrzyn
    Contributor

    Hold for #49539

  18. Christinadobrzyn commented on Jan 29, 2025

    @Christinadobrzyn
    Contributor

    Hold for #49539

  19. Christinadobrzyn commented on Feb 6, 2025

    @Christinadobrzyn
    Contributor

    Hold for #49539

  20. Christinadobrzyn commented on Feb 14, 2025

    @Christinadobrzyn
    Contributor

    #49539 is merged... I guess we need to retest. Moving to daily to test

  21. ntdiary commented on Feb 17, 2025

    @ntdiary
    Contributor

    #49539 is merged... I guess we need to retest. Moving to daily to test

    @Christinadobrzyn, this issue has been fixed. :)

    test.mov
  22. Christinadobrzyn commented on Feb 19, 2025

    @Christinadobrzyn
    Contributor

    Yay! Closing this out as complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugDailyExternalHelp WantedWeekly

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions