Skip to content

[$250] Workspace - mWeb - It's not here page opens after deleting WS from another device #64359

Closed

Description

@jponikarchuk

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.1.68-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: #62849
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Device used: Apple iPhone 12 Pro / Safari
App Component: Other

Action Performed:

Precondition: Log into the same new Gmail account in the main (mWeb), and secondary (web, or desktop) device.

  1. mWeb: Navigate to https://staging.new.expensify.com/
  2. mWeb: Create a workspace and stay at the main WS page
  3. Web: Delete the workspace
  4. mWeb: Tap on "Go back to home page"
  5. mWeb: Tap on "Workspaces"

Expected Result:

I should be navigated to the workspace list.

Actual Result:

"Hmm... it's not here" page opens after deleting WS from another device and navigating to the workspace list.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021938729819676862550
  • Upwork Job ID: 1938729819676862550
  • Last Price Increase: 2025-09-08
Issue OwnerCurrent Issue Owner: @hoangzinh

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jun 17, 2025
  2. melvin-bot commented on Jun 17, 2025

    @melvin-bot

    Triggered auto assignment to @RachCHopkins (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. changed the title [-]Workspace - mWeb - it's not here page opens after deleting WS from another device[/-] [+]Workspace - mWeb - It's not here page opens after deleting WS from another device[/+] on Jun 17, 2025
  4. truph01 commented on Jun 17, 2025

    @truph01
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2025-06-17 21:18:45 UTC.

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    • Workspace - mWeb - It's not here page opens after deleting WS from another device

    What is the root cause of that problem?

    • When the user clicks on the workspace tab, the app attempts to restore the last accessed workspace using this logic.
    • The last accessed workspace path is stored in session storage under the key LAST_VISITED_PATH_WORKSPACES_TAB.
    • If that path references a now-deleted workspace, the user sees an error page.

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

    • We should clear the LAST_VISITED_PATH_WORKSPACES_TAB value in session storage when the user clicks "Go back to home page" on the workspace initial page.
      onLinkPress={Navigation.goBackToHome}

      Proposed code update:
    
    onLinkPress={() => {
        Navigation.goBackToHome();
        saveWorkspacesTabPathToSessionStorage(''); // Pseudocode
    }}
    

    This ensures that when the user returns to the workspace tab later, the app won’t attempt to navigate to a deleted workspace.

    • We can consider applying the cleanup to other workspace pages as well.

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    • None

    What alternative solutions did you explore? (Optional)

    Solution 1

    • We can update the goBackToHome function in Navigation.ts file so that it calls saveWorkspacesTabPathToSessionStorage('') directly.

    Solution 2

                    onLinkPress={goBackFromInvalidPolicy}
    
  5. dmkt9 commented on Jun 18, 2025

    @dmkt9
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    "Hmm... it's not here" page opens after deleting WS from another device and navigating to the workspace list.

    What is the root cause of that problem?

    1. Because when accessing a workspace, the workspace tab state is saved to session storage and then retrieved here when you click the workspace button in the navigator bar:
      const state = getWorkspacesTabStateFromSessionStorage() ?? rootState;
    2. Because we only check for a policyID in the params before navigating to the workspace, this leads to the following error:
      if (params.policyID) {
      const workspaceScreenName = !shouldUseNarrowLayout ? getLastVisitedWorkspaceTabScreen() : SCREENS.WORKSPACE.INITIAL;
      // This action will put settings split under the workspace split to make sure that we can swipe back to settings split.
      navigationRef.dispatch({
      type: CONST.NAVIGATION.ACTION_TYPE.OPEN_WORKSPACE_SPLIT,
      payload: {
      policyID: params.policyID,
      screenName: workspaceScreenName,
      },
      });
      }

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

    • We should verify that the workspace is actually accessible using shouldShowPolicy—just as it’s used to filter the workspace list in WorkspacesListPage:
      return Object.values(policies)
      .filter((policy): policy is PolicyType => shouldShowPolicy(policy, isOffline, session?.email))

    Use

    const policy = getPolicy(params.policyID);
    if (params.policyID && shouldShowPolicy(policy, false, undefined)) {

    instead of

    • Move the return statement inside the if so that it falls back to the workspace list when the policy isn’t accessible. The complete code would then look like this:
    const policy = getPolicy(params.policyID);
    // Screens of this navigator should always have policyID
    if (params.policyID && shouldShowPolicy(policy, false, undefined)) {
        const workspaceScreenName = !shouldUseNarrowLayout ? getLastVisitedWorkspaceTabScreen() : SCREENS.WORKSPACE.INITIAL;
        // This action will put settings split under the workspace split to make sure that we can swipe back to settings split.
        navigationRef.dispatch({
            type: CONST.NAVIGATION.ACTION_TYPE.OPEN_WORKSPACE_SPLIT,
            payload: {
                policyID: params.policyID,
                screenName: workspaceScreenName,
            },
        });
        return;
    }

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    NA

    What alternative solutions did you explore? (Optional)

    NA

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  6. truph01 commented on Jun 18, 2025

    @truph01
    Contributor

    Proposal updated

    • Added Solution 2 section
  7. melvin-bot commented on Jun 23, 2025

    @melvin-bot

    @RachCHopkins Eep! 4 days overdue now. Issues have feelings too...

  8. melvin-bot commented on Jun 25, 2025

    @melvin-bot

    @RachCHopkins 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

  9. melvin-bot commented on Jun 27, 2025

    @melvin-bot

    @RachCHopkins 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!

  10. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jun 27, 2025
  11. changed the title [-]Workspace - mWeb - It's not here page opens after deleting WS from another device[/-] [+][$250] Workspace - mWeb - It's not here page opens after deleting WS from another device[/+] on Jun 27, 2025
  12. melvin-bot commented on Jun 27, 2025

    @melvin-bot
  13. 61 remaining items

  14. melvin-bot commented on Sep 1, 2025

    @melvin-bot

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

  15. hoangzinh commented on Sep 1, 2025

    @hoangzinh
    Contributor

    cc @RachCHopkins looks like we can close this issue

  16. mvtglobally commented on Sep 5, 2025

    @mvtglobally

    Issue not reproducible during KI retests. (Second week)

  17. melvin-bot commented on Sep 5, 2025

    @melvin-bot

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

  18. hoangzinh commented on Sep 6, 2025

    @hoangzinh
    Contributor

    Ping @RachCHopkins in Slack to close this issue

  19. melvin-bot commented on Sep 8, 2025

    @melvin-bot

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

  20. hoangzinh commented on Sep 9, 2025

    @hoangzinh
    Contributor

    Awaiting @RachCHopkins to close this issue

  21. RachCHopkins commented on Sep 11, 2025

    @RachCHopkins
    Contributor

    Sorry, have been OOO! Closed!

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributorsretest-weeklyApply this label if you want this issue tested on a Weekly basis by Applause

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions