Repository navigation
[$500] [Wave Collect] [Ideal Nav] Workspace switcher - "Expensify" and workspace are ticked when returning from workspace [Payment due March 6] #35680
Description
Activity
- addedDeployBlockerCashThis issue or pull request should block deploymentThis issue or pull request should block deployment
on Feb 2, 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:
- Identify the pull request that introduced this issue and revert it.
- Find someone who can quickly fix the issue.
- Fix the issue yourself.
Triggered auto assignment to @amyevans (
Engineering), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.We think that this bug might be related to #vip-vsp
CC @quintharProposal
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 pointActiveWorkspaceIDisundefinedso theexpensifyicon is ticked.
TheactiveWorkspaceIDis always based onrouteand navigation state.
When we create new workspace, the route becomeshttps://dev.new.expensify.com:8082/workspace/32DF7AB51CD026CA/overviewwhich means theactiveWorkspaceIDgets set to32DF7AB51CD026CA(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 theactiveWorkspaceIDbecomesundefinedagain as there is noIDin the route.But the code for selecting the workspace icon doesn't update if the
activeWorkspacecIDisundefinedhere:
App/src/pages/WorkspaceSwitcherPage.tsx
Lines 281 to 286 in e6ea03b
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:
App/src/pages/WorkspaceSwitcherPage.tsx
Lines 281 to 286 in e6ea03b
useEffect(() => { if (!activeWorkspaceID) { return; } const optionToSet = usersWorkspaces.find((option) => option.policyID === activeWorkspaceID); setSelectedOption(optionToSet);
And remove theif conditionandearly return, thus allowing thesetSelectedOptionto be set toundefinedwhich it should be as we are going back to the point where there was not anactiveWorkspace.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:
App/src/pages/WorkspaceSwitcherPage.tsx
Lines 218 to 220 in e6ea03b
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:
App/src/pages/WorkspaceSwitcherPage.tsx
Lines 112 to 115 in e6ea03b
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.
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).
- removedDeployBlockerCashThis issue or pull request should block deploymentThis issue or pull request should block deployment
on Feb 2, 2024 - 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 - moved this to Release 1: Ideal Nav & Collect Simplfied Profile, Members, Categories, Workflows (approvals) in [#whatsnext] Wave 08 - Collect Plan Admins
on Feb 2, 2024 24 remaining items
@isabelastisser automation failed here.
PR was deployed to production already. Mar 6 is payment date@situchan, great, thanks for the heads up!
- 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 - 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
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsRelease 1: Ideal Nav & Collect Simplfied Profile, Members, Categories, Workflows (approvals)
- StatusShow more project fieldsDone
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:
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?
Screenshots/Videos
Add any screenshot/video evidence
Bug6365089_1706894608391.20240202_235634__1_.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit