App icon indicating copy to clipboard operation
App copied to clipboard

[$500] [Wave 8] [Ideal Nav] Workspace switcher - "Expensify" and workspace are ticked when returning from workspace

Open lanitochka17 opened this issue 1 year ago β€’ 15 comments

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: 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
  • [x] MacOS: Chrome / Safari
  • [ ] MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/Expensify/App/assets/78819774/89434aab-aec5-4dc9-a799-a0a2205225fc

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

lanitochka17 avatar Feb 02 '24 17:02 lanitochka17

: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:

  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.

github-actions[bot] avatar Feb 02 '24 17:02 github-actions[bot]

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

melvin-bot[bot] avatar Feb 02 '24 17:02 melvin-bot[bot]

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

lanitochka17 avatar Feb 02 '24 17:02 lanitochka17

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: https://github.com/Expensify/App/blob/e6ea03b9278029acacb424856b58dee2d1134d9d/src/pages/WorkspaceSwitcherPage.tsx#L281-L286

What changes should be made to fix this?

We should modify this code: https://github.com/Expensify/App/blob/e6ea03b9278029acacb424856b58dee2d1134d9d/src/pages/WorkspaceSwitcherPage.tsx#L281-L286 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

https://github.com/Expensify/App/assets/77237602/3a7e0f40-f6df-40e9-b5aa-c2a256b7cb7f

What alternative did you explore?

We can also use Navigation.goBack() before we create a new workspace here: https://github.com/Expensify/App/blob/e6ea03b9278029acacb424856b58dee2d1134d9d/src/pages/WorkspaceSwitcherPage.tsx#L218-L220 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: https://github.com/Expensify/App/blob/e6ea03b9278029acacb424856b58dee2d1134d9d/src/pages/WorkspaceSwitcherPage.tsx#L112-L115

Result

https://github.com/Expensify/App/assets/77237602/2dcaf8dc-37fc-42e4-8d52-d93c11937f37

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

esh-g avatar Feb 02 '24 17:02 esh-g

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 https://github.com/orgs/Expensify/projects/94/views/2.

amyevans avatar Feb 02 '24 19:02 amyevans

Triggered auto assignment to @isabelastisser (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

melvin-bot[bot] avatar Feb 02 '24 19:02 melvin-bot[bot]

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

melvin-bot[bot] avatar Feb 02 '24 19:02 melvin-bot[bot]

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

melvin-bot[bot] avatar Feb 02 '24 19:02 melvin-bot[bot]

@situchan, can you please review the proposal above? Thanks!

isabelastisser avatar Feb 05 '24 14:02 isabelastisser

Bump @situchan. Please let me know if you would like me to reassign this. Thanks!

isabelastisser avatar Feb 07 '24 18:02 isabelastisser

sorry reviewing now

situchan avatar Feb 07 '24 19:02 situchan

@esh-g's alternative solution looks good to me. πŸŽ€ πŸ‘€ πŸŽ€ C+ reviewed

situchan avatar Feb 07 '24 19:02 situchan

Current assignee @amyevans is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

melvin-bot[bot] avatar Feb 07 '24 19:02 melvin-bot[bot]

πŸ“£ @situchan πŸŽ‰ An offer has been automatically sent to your Upwork account for the Reviewer role πŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job

melvin-bot[bot] avatar Feb 07 '24 21:02 melvin-bot[bot]

πŸ“£ @esh-g πŸŽ‰ 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 πŸ“–

melvin-bot[bot] avatar Feb 07 '24 21:02 melvin-bot[bot]

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

isabelastisser avatar Mar 01 '24 18:03 isabelastisser

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

situchan avatar Mar 01 '24 18:03 situchan

@situchan, great, thanks for the heads up!

isabelastisser avatar Mar 01 '24 18:03 isabelastisser

The payments were processed in Upwork.

  • @esh-g Reviewer $500
  • @situchan Contributor $500

All set!

isabelastisser avatar Mar 06 '24 03:03 isabelastisser