App icon indicating copy to clipboard operation
App copied to clipboard

[$250] iOS/Android - App returns to account settings instead of workspace list after deleting workspace

Open IuliiaHerets opened this issue 1 year ago β€’ 11 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.69-1 Reproducible in staging?: Y Reproducible in production?: N If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y Email or phone of affected tester (no customers): [email protected] Issue reported by: Applause Internal Team

Action Performed:

Precondition:

  • Account has three workspaces.
  1. Launch ND or hybrid app.
  2. Go to workspace settings > Profile.
  3. Tap Delete.
  4. Delete the workspace.
  5. Note that app returns to the workspace list after deleting workspace.
  6. Go to Search.
  7. Open workspace switcher and select a workspace.
  8. Go to workspace settings (same workspace selected in Step 7) > Profile.
  9. Delete the workspace.

Expected Result:

App will return to the workspace list after deleting the workspace which is previously selected in workspace switcher.

Actual Result:

App returns to account settings after deleting the workspace which is previously selected in workspace switcher.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

https://github.com/user-attachments/assets/eff8364d-1a5e-4f6e-be6a-d5b765962e26

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021863284084695431644
  • Upwork Job ID: 1863284084695431644
  • Last Price Increase: 2024-12-08
Issue OwnerCurrent Issue Owner: @garrettmknight

IuliiaHerets avatar Dec 01 '24 10:12 IuliiaHerets

Triggered auto assignment to @garrettmknight (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 Dec 01 '24 10:12 melvin-bot[bot]

Triggered auto assignment to @lakchote (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

melvin-bot[bot] avatar Dec 01 '24 10:12 melvin-bot[bot]

πŸ’¬ A slack conversation has been started in #expensify-open-source

melvin-bot[bot] avatar Dec 01 '24 10:12 melvin-bot[bot]

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

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

github-actions[bot] avatar Dec 01 '24 10:12 github-actions[bot]

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

melvin-bot[bot] avatar Dec 01 '24 18:12 melvin-bot[bot]

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

melvin-bot[bot] avatar Dec 01 '24 18:12 melvin-bot[bot]

Demoting as it does not block the user

mountiny avatar Dec 01 '24 18:12 mountiny

@garrettmknight, @eVoloshchak, @lakchote Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] avatar Dec 05 '24 09:12 melvin-bot[bot]

Still looking for proposals.

lakchote avatar Dec 06 '24 07:12 lakchote

Yep, still looking for proposals!

garrettmknight avatar Dec 06 '24 17:12 garrettmknight

πŸ“£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πŸ’Έ

melvin-bot[bot] avatar Dec 08 '24 16:12 melvin-bot[bot]

@ishpaul777 since you've authored this code related to switching back to All workspaces view upon workspace deletion, could you take a look please?

lakchote avatar Dec 09 '24 15:12 lakchote

πŸ“£ @ishpaul777 πŸŽ‰ An offer has been automatically sent to your Upwork account for the Contributor role πŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review πŸ§‘β€πŸ’» Keep in mind: Code of Conduct | Contributing πŸ“–

melvin-bot[bot] avatar Dec 12 '24 10:12 melvin-bot[bot]

@ishpaul777 assigning you so you can take a look!

garrettmknight avatar Dec 12 '24 10:12 garrettmknight

Issue not reproducible during KI retests. (First week)

mvtglobally avatar Dec 14 '24 05:12 mvtglobally

@garrettmknight @lakchote @ishpaul777 this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

melvin-bot[bot] avatar Dec 15 '24 09:12 melvin-bot[bot]

@garrettmknight, @lakchote, @ishpaul777 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] avatar Dec 16 '24 09:12 melvin-bot[bot]

Issue not reproducible during KI retests. (First week)

Tested it on staging v9.0.76-6, and it's reproducible @mvtglobally?

https://github.com/user-attachments/assets/d42458e4-0c46-44d6-a71b-4222f6bf90ba

@ishpaul777 can you look into it please?

lakchote avatar Dec 16 '24 09:12 lakchote

I am able to reproduce as well.

since you've authored this code related to switching back to All workspaces view upon workspace deletion,

yes i did authored this piece of code few months back, but code related to switch policy id is quite evolved since then https://github.com/Expensify/App/blob/b8579b1ab0445c32bea41486b28bb78a240b1454/src/libs/Navigation/switchPolicyID.ts#L89-L107

I tried to look for solution but didn't get anything satifactory.

passing workspace list route as param from here is creating regressions and not switch the worksapce at all

https://github.com/Expensify/App/blob/f7f2557b2bc3cbbc3acff3a495ec010c946c456e/src/libs/Navigation/switchPolicyID.ts#L76

i'll keep looking into it and post a proposal if i found anything but we should keep looking for proposals from community to resolve this faster...

ishpaul777 avatar Dec 16 '24 17:12 ishpaul777

tagging @adamgrzybowski @WojtekBoman , since i recall you both working on bunch of navigation related issues, your help would be much appreaciated here. Thank you!

ishpaul777 avatar Dec 16 '24 17:12 ishpaul777

Hey πŸ‘‹

I took a look at it and found a possible solution for this issue. It is caused by the current logic of the switchPolicyID function, a new Settings_Root page is pushed to the navigation state when switching policyID to global after deleting the currently selected workspace. It can be noticed also when we remove the current workspace from the workspaces list page. I'm attaching a video with a reproduction.

To solve this issue we can use this logic:

 // src/pages/workspace/WorkspaceProfilePage.tsx
 const confirmDeleteAndHideModal = useCallback(() => {
        if (!policy?.id || !policyName) {
            return;
        }

        Policy.deleteWorkspace(policy?.id, policyName);
        setIsDeleteModalOpen(false);

        // If the workspace being deleted is the active workspace, switch to the "All Workspaces" view
        if (activeWorkspaceID === policy?.id) {
            setActiveWorkspaceID(undefined);
            Navigation.dismissModal();
            const rootState = navigationRef.current?.getRootState() as State<RootStackParamList>;
            const topmostBottomTabRoute = getTopmostBottomTabRoute(rootState);
            Navigation.setParams({policyID: undefined}, topmostBottomTabRoute?.key);
        }
    }, [policy?.id, policyName, activeWorkspaceID, setActiveWorkspaceID]);

It dismisses the FullScreenNavigator and then changes Settings_Root params instead of pushing a new one. This logic should be applied also in src/pages/workspace/WorkspacesListPage.tsx, but without dismissing modal as FullScreenNavigator is not displayed there.

It requires a slight modification in getTopmostBottomTabRoute, the route key should be also returned in the result object.

Reproduction of the second issue related to this code:

https://github.com/user-attachments/assets/107ee021-5068-4321-827e-99e15ed3426f

I suppose after deleting the workspace we would like to stay on the list screen

WojtekBoman avatar Dec 17 '24 15:12 WojtekBoman

Thanks @ishpaul777 for tagging SWM team.

@WojtekBoman thanks for your findings!

I suppose after deleting the workspace we would like to stay on the list screen

Yes, we'd need to return to the workspaces list.

lakchote avatar Dec 17 '24 15:12 lakchote

@WojtekBoman Would you be able to raise a PR for this i can review it as c+

ishpaul777 avatar Dec 20 '24 16:12 ishpaul777

@ishpaul777

Here's the PR :)

WojtekBoman avatar Dec 23 '24 09:12 WojtekBoman

Reviewing label has been removed, please complete the "BugZero Checklist".

melvin-bot[bot] avatar Jan 08 '25 02:01 melvin-bot[bot]

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.81-6 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

  • https://github.com/Expensify/App/pull/54458

If no regressions arise, payment will be issued on 2025-01-15. :confetti_ball:

For reference, here are some details about the assignees on this issue:

melvin-bot[bot] avatar Jan 08 '25 02:01 melvin-bot[bot]

@ishpaul777 @garrettmknight @ishpaul777 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]

melvin-bot[bot] avatar Jan 08 '25 02:01 melvin-bot[bot]

Awaiting pay date, i'll fill out BZ checklist soon

ishpaul777 avatar Jan 14 '25 11:01 ishpaul777

@ishpaul777 mind filling out the checklist today so I can pay tomo?

garrettmknight avatar Jan 14 '25 17:01 garrettmknight

BugZero Checklist:

  • [x] [Contributor] Classify the bug:
Bug classification

Source of bug:

  • [ ] 1a. Result of the original design (eg. a case wasn't considered)
  • [x] 1b. Mistake during implementation
  • [ ] 1c. Backend bug
  • [ ] 1z. Other:

Where bug was reported:

  • [ ] 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
  • [x] 2b. Reported on staging (eg. found during regression or PR testing)
  • [ ] 2d. Reported on a PR
  • [ ] 2z. Other:

Who reported the bug:

  • [ ] 3a. Expensify user
  • [ ] 3b. Expensify employee
  • [ ] 3c. Contributor
  • [x] 3d. QA
  • [ ] 3z. Other:
  • [x] [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: its hard to tell what exactly changed after https://github.com/Expensify/App/pull/38365 that caused this bug navigation architecture i quite evolved since this PR can't point it on a single PR

  • [x] [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: not Critical, normal navigation bug

  • [x] [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. - not required

ishpaul777 avatar Jan 16 '25 22:01 ishpaul777