Skip to content

[$500] [Wave Collect] [Ideal Nav] Workspace switcher - "Expensify" and workspace are ticked when returning from workspace [Payment due March 6] #35680

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: 1.4-36.0
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4264387
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Open workspace switcher
  2. Click +
  3. Click browser back button

Expected Result:

Only "Expensify" will be selected

Actual Result:

"Expensify" and the previous workspace are ticked at the same time

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6365089_1706894608391.20240202_235634__1_.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01e52e8d993f5ba021
  • Upwork Job ID: 1753506244878921728
  • Last Price Increase: 2024-02-02
  • Automatic offers:
    • situchan | Reviewer | 28149266
    • esh-g | Contributor | 28149267

Activity

  1. github-actions commented on Feb 2, 2024

    @github-actions
    Contributor

    👋 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.
  2. melvin-bot commented on Feb 2, 2024

    @melvin-bot

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

  3. lanitochka17 commented on Feb 2, 2024

    @lanitochka17
    Author

    We think that this bug might be related to #vip-vsp
    CC @quinthar

  4. esh-g commented on Feb 2, 2024

    @esh-g
    Contributor

    Proposal

    Please re-state the problem we are trying to fix

    "Expensify" and workspace are ticked when returning from workspace

    Root cause

    The root cause of this issue is that at first when we don't have an active workspace set, and open workspace switcher, we are on route: https://dev.new.expensify.com:8082/workspace-switcher. At this point ActiveWorkspaceID is undefined so the expensify icon is ticked.
    The activeWorkspaceID is always based on route and navigation state.
    When we create new workspace, the route becomes https://dev.new.expensify.com:8082/workspace/32DF7AB51CD026CA/overview which means the activeWorkspaceID gets set to 32DF7AB51CD026CA (based on navigation state), and when we click back once again, we go to the original route: https://dev.new.expensify.com:8082/workspace-switcher, at this point the activeWorkspaceID becomes undefined again as there is no ID in the route.

    But the code for selecting the workspace icon doesn't update if the activeWorkspacecID is undefined here:

    useEffect(() => {
    if (!activeWorkspaceID) {
    return;
    }
    const optionToSet = usersWorkspaces.find((option) => option.policyID === activeWorkspaceID);
    setSelectedOption(optionToSet);

    What changes should be made to fix this?

    We should modify this code:

    useEffect(() => {
    if (!activeWorkspaceID) {
    return;
    }
    const optionToSet = usersWorkspaces.find((option) => option.policyID === activeWorkspaceID);
    setSelectedOption(optionToSet);

    And remove the if condition and early return, thus allowing the setSelectedOption to be set to undefined which it should be as we are going back to the point where there was not an activeWorkspace.

    Result
    Screen.Recording.2024-02-02.at.11.25.52.PM.mov

    What alternative did you explore?

    We can also use Navigation.goBack() before we create a new workspace here:

    onPress={() => {
    App.createWorkspaceWithPolicyDraftAndNavigateToIt();
    }}

    This will make sure that the workspace switcher was closed before new workspace was created so user can't navigate back to it.
    This is the same approach we take while switching active policy here:
    Navigation.goBack();
    if (policyID !== activeWorkspaceID) {
    Navigation.navigateWithSwitchPolicyID({policyID, isPolicyAdmin});
    }

    Result
    Screen.Recording.2024-02-02.at.11.45.48.PM.mov

    PS: I would prefer the alternate solution instead of the main one.

  5. amyevans commented on Feb 2, 2024

    @amyevans
    Contributor

    This is a regression from Ideal Nav, but it's pretty minor so doesn't need to block deploy. Confirmed it's not a dupe of any issues listed in [#whatsnext] Wave 08 - Collect Plan Admins (view).

  6. changed the title [-] Workspace switcher - "Expensify" and workspace are ticked when returning from workspace[/-] [+][Wave 8] [Ideal Nav] Workspace switcher - "Expensify" and workspace are ticked when returning from workspace[/+] on Feb 2, 2024
  7. added and removed on Feb 2, 2024
  8. moved this to Release 1: Ideal Nav & Collect Simplfied Profile, Members, Categories, Workflows (approvals) in [#whatsnext] Wave 08 - Collect Plan Adminson Feb 2, 2024
  9. 24 remaining items

  10. isabelastisser commented on Mar 1, 2024

    @isabelastisser
    Contributor

    @esh-g @situchan let's priorizite this! Can you please share an update? Thanks!

  11. situchan commented on Mar 1, 2024

    @situchan
    Contributor

    @isabelastisser automation failed here.
    PR was deployed to production already. Mar 6 is payment date

  12. isabelastisser commented on Mar 1, 2024

    @isabelastisser
    Contributor

    @situchan, great, thanks for the heads up!

  13. changed the title [-][$500] [Wave 8] [Ideal Nav] Workspace switcher - "Expensify" and workspace are ticked when returning from workspace[/-] [+][$500] [Wave 8] [Ideal Nav] Workspace switcher - "Expensify" and workspace are ticked when returning from workspace [Payment due March 6][/+] on Mar 1, 2024
  14. changed the title [-][$500] [Wave 8] [Ideal Nav] Workspace switcher - "Expensify" and workspace are ticked when returning from workspace [Payment due March 6][/-] [+][$500] [Wave Collect] [Ideal Nav] Workspace switcher - "Expensify" and workspace are ticked when returning from workspace [Payment due March 6][/+] on Mar 5, 2024
  15. isabelastisser commented on Mar 6, 2024

    @isabelastisser
    Contributor

    The payments were processed in Upwork.

    All set!

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.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in review

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions