Skip to content

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

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

Closed
1 of 6 tasks
lanitochka17 opened this issue Feb 2, 2024 · 19 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review

Comments

@lanitochka17
Copy link

lanitochka17 commented Feb 2, 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: 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
@lanitochka17 lanitochka17 added the DeployBlockerCash This issue or pull request should block deployment label Feb 2, 2024
Copy link
Contributor

github-actions bot commented 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:

  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.

Copy link

melvin-bot bot commented Feb 2, 2024

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

@lanitochka17
Copy link
Author

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

@esh-g
Copy link
Contributor

esh-g commented Feb 2, 2024

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.

@amyevans
Copy link
Contributor

amyevans commented Feb 2, 2024

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

@amyevans amyevans removed the DeployBlockerCash This issue or pull request should block deployment label Feb 2, 2024
@amyevans amyevans 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 Feb 2, 2024
@amyevans amyevans added Daily KSv2 and removed Hourly KSv2 labels Feb 2, 2024
@amyevans amyevans moved this to Release 1: Ideal Nav & Collect Simplfied Profile, Members, Categories, Workflows (approvals) in [#whatsnext] Wave 08 - Collect Plan Admins Feb 2, 2024
@amyevans amyevans added the Bug Something is broken. Auto assigns a BugZero manager. label Feb 2, 2024
Copy link

melvin-bot bot commented Feb 2, 2024

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

@amyevans amyevans added the External Added to denote the issue can be worked on by a contributor label Feb 2, 2024
@melvin-bot melvin-bot bot changed the title [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 Feb 2, 2024
Copy link

melvin-bot bot commented Feb 2, 2024

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

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

melvin-bot bot commented Feb 2, 2024

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

@melvin-bot melvin-bot bot added the Overdue label Feb 5, 2024
@isabelastisser
Copy link
Contributor

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

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Feb 5, 2024
@isabelastisser
Copy link
Contributor

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

@melvin-bot melvin-bot bot removed the Overdue label Feb 7, 2024
@situchan
Copy link
Contributor

situchan commented Feb 7, 2024

sorry reviewing now

@situchan
Copy link
Contributor

situchan commented Feb 7, 2024

@esh-g's alternative solution looks good to me.
🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Feb 7, 2024

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

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 7, 2024
Copy link

melvin-bot bot commented Feb 7, 2024

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

Copy link

melvin-bot bot commented Feb 7, 2024

📣 @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 melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Feb 8, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Feb 26, 2024
@isabelastisser isabelastisser added Daily KSv2 and removed Weekly KSv2 labels Mar 1, 2024
@isabelastisser
Copy link
Contributor

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

@situchan
Copy link
Contributor

situchan commented Mar 1, 2024

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

@isabelastisser
Copy link
Contributor

@situchan, great, thanks for the heads up!

@isabelastisser isabelastisser 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] Mar 1, 2024
@trjExpensify trjExpensify 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] Mar 5, 2024
@isabelastisser
Copy link
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
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review
Projects
No open projects
Archived in project
Status: Release 1: Ideal Nav & Collect Simplfied Profile, Members, Categories, Workflows (approvals)
Development

No branches or pull requests

5 participants