[$250] iOS/Android - App returns to account settings instead of workspace list after deleting 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.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.
- Launch ND or hybrid app.
- Go to workspace settings > Profile.
- Tap Delete.
- Delete the workspace.
- Note that app returns to the workspace list after deleting workspace.
- Go to Search.
- Open workspace switcher and select a workspace.
- Go to workspace settings (same workspace selected in Step 7) > Profile.
- 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
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 Owner
Current Issue Owner: @garrettmknight
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.
Triggered auto assignment to @lakchote (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.
π¬ A slack conversation has been started in #expensify-open-source
: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:
- Identify the pull request that introduced this issue and revert it.
- Find someone who can quickly fix the issue.
- Fix the issue yourself.
Job added to Upwork: https://www.upwork.com/jobs/~021863284084695431644
Triggered auto assignment to Contributor-plus team member for initial proposal review - @eVoloshchak (External)
Demoting as it does not block the user
@garrettmknight, @eVoloshchak, @lakchote Whoops! This issue is 2 days overdue. Let's get this updated quick!
Still looking for proposals.
Yep, still looking for proposals!
π£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πΈ
@ishpaul777 since you've authored this code related to switching back to All workspaces view upon workspace deletion, could you take a look please?
π£ @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 π
@ishpaul777 assigning you so you can take a look!
Issue not reproducible during KI retests. (First week)
@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!
@garrettmknight, @lakchote, @ishpaul777 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
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?
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...
tagging @adamgrzybowski @WojtekBoman , since i recall you both working on bunch of navigation related issues, your help would be much appreaciated here. Thank you!
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
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.
@WojtekBoman Would you be able to raise a PR for this i can review it as c+
Reviewing label has been removed, please complete the "BugZero Checklist".
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:
- @ishpaul777 requires payment automatic offer (Contributor)
@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]
Awaiting pay date, i'll fill out BZ checklist soon
@ishpaul777 mind filling out the checklist today so I can pay tomo?
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