Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
4 of 8 tasks
IuliiaHerets opened this issue Dec 1, 2024 · 24 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Dec 1, 2024

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:

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

Screenshots/Videos

Bug6681079_1733043130797.ScreenRecording_12-01-2024_16-43-01_1.mp4

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
  • Automatic offers:
    • ishpaul777 | Contributor | 105304897
@IuliiaHerets IuliiaHerets added DeployBlockerCash This issue or pull request should block deployment Bug Something is broken. Auto assigns a BugZero manager. labels Dec 1, 2024
Copy link

melvin-bot bot commented Dec 1, 2024

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.

Copy link

melvin-bot bot commented Dec 1, 2024

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

@melvin-bot melvin-bot bot added the Daily KSv2 label Dec 1, 2024
Copy link

melvin-bot bot commented Dec 1, 2024

💬 A slack conversation has been started in #expensify-open-source

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Dec 1, 2024
Copy link
Contributor

github-actions bot commented Dec 1, 2024

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

@mountiny mountiny added Daily KSv2 External Added to denote the issue can be worked on by a contributor and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Dec 1, 2024
@melvin-bot melvin-bot bot changed the title iOS/Android - App returns to account settings instead of workspace list after deleting workspace [$250] iOS/Android - App returns to account settings instead of workspace list after deleting workspace Dec 1, 2024
Copy link

melvin-bot bot commented Dec 1, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 1, 2024
Copy link

melvin-bot bot commented Dec 1, 2024

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

@mountiny
Copy link
Contributor

mountiny commented Dec 1, 2024

Demoting as it does not block the user

Copy link

melvin-bot bot commented Dec 5, 2024

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

@melvin-bot melvin-bot bot added the Overdue label Dec 5, 2024
@lakchote
Copy link
Contributor

lakchote commented Dec 6, 2024

Still looking for proposals.

@garrettmknight
Copy link
Contributor

Yep, still looking for proposals!

@melvin-bot melvin-bot bot removed the Overdue label Dec 6, 2024
Copy link

melvin-bot bot commented Dec 8, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot melvin-bot bot added the Overdue label Dec 9, 2024
@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Dec 9, 2024
@melvin-bot melvin-bot bot removed Help Wanted Apply this label when an issue is open to proposals by contributors Overdue labels Dec 12, 2024
Copy link

melvin-bot bot commented Dec 12, 2024

📣 @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 📖

@garrettmknight
Copy link
Contributor

@ishpaul777 assigning you so you can take a look!

@mvtglobally
Copy link

Issue not reproducible during KI retests. (First week)

Copy link

melvin-bot bot commented Dec 15, 2024

@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 melvin-bot bot added the Overdue label Dec 15, 2024
Copy link

melvin-bot bot commented Dec 16, 2024

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

@lakchote
Copy link
Contributor

Issue not reproducible during KI retests. (First week)

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

ScreenRecording_12-16-2024.10-38-24_1.MP4

@ishpaul777 can you look into it please?

@melvin-bot melvin-bot bot removed the Overdue label Dec 16, 2024
@ishpaul777
Copy link
Contributor

ishpaul777 commented Dec 16, 2024

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

const rootState = navigation.getRootState() as NavigationState<RootStackParamList>;
const topmostCentralPaneRoute = getTopmostCentralPaneRoute(rootState);
let newPath = route ?? getPathFromState({routes: rootState.routes} as State, linkingConfig.config);
// Currently, the search page displayed in the bottom tab has the same URL as the page in the central pane, so we need to redirect to the correct search route.
// Here's the configuration: src/libs/Navigation/AppNavigator/createResponsiveStackNavigator/index.tsx
const isOpeningSearchFromBottomTab = !route && topmostCentralPaneRoute?.name === SCREENS.SEARCH.CENTRAL_PANE;
if (isOpeningSearchFromBottomTab) {
newPath = ROUTES.SEARCH_CENTRAL_PANE.getRoute({query: SearchQueryUtils.buildCannedSearchQuery()});
}
const stateFromPath = getStateFromPath(newPath as Route) as PartialState<NavigationState<RootStackParamList>>;
const action: StackNavigationAction = getActionFromState(stateFromPath, linkingConfig.config);
const actionForBottomTabNavigator = getActionForBottomTabNavigator(action, rootState, policyID);
if (!actionForBottomTabNavigator) {
return;
}

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

export default function switchPolicyID(navigation: NavigationContainerRef<RootStackParamList> | null, {policyID, route}: SwitchPolicyIDParams) {

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
Copy link
Contributor

ishpaul777 commented Dec 16, 2024

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

@WojtekBoman
Copy link
Contributor

WojtekBoman commented Dec 17, 2024

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:

Screen.Recording.2024-12-17.at.16.23.26.mov

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

@lakchote
Copy link
Contributor

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.

@garrettmknight garrettmknight moved this to Bugs and Follow Up Issues in [#whatsnext] #expense Dec 18, 2024
@melvin-bot melvin-bot bot added the Overdue label Dec 20, 2024
@ishpaul777
Copy link
Contributor

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

@WojtekBoman
Copy link
Contributor

@ishpaul777

Here's the PR :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
Status: Bugs and Follow Up Issues
Development

No branches or pull requests

8 participants