Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.5k stars 2.85k forks source link

[HOLD for payment 2024-11-01] [$250] TransitionOD-ND - When disabling tax in OD, ND "page not Found", "Back" takes to WS selection #50465

Open lanitochka17 opened 2 weeks ago

lanitochka17 commented 2 weeks ago

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.0.46-3 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/5053996 Issue reported by: Applause - Internal Team

Action Performed:

  1. Open ND App
  2. Create a WS
  3. Log in as the same user in OD
  4. In OD Click on Workspaces
  5. Select the same WS as in ND
  6. In OD go to WS settings and enable Tax
  7. In ND go to WS settings, on LHP click on Tax icon 8.With Tax page open in ND, navigate to OD and disable Tax option

Expected Result:

In ND the user is navigated to the LHP/WS editor page

Actual Result:

The user is shown "Ops...It's not here" page, the "Back" button takes you back to the WS selection page(User leaves the WS editor page)

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/user-attachments/assets/f79895d5-f082-4c99-9529-3921efb87aa1

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021845793851841023680
  • Upwork Job ID: 1845793851841023680
  • Last Price Increase: 2024-10-14
Issue OwnerCurrent Issue Owner: @sonialiap
melvin-bot[bot] commented 2 weeks ago

Triggered auto assignment to @sonialiap (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.

lanitochka17 commented 2 weeks ago

@sonialiap FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

bernhardoj commented 2 weeks ago

Proposal

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

Going back from not found tax page leads to workspace list page.

What is the root cause of that problem?

When we disable the tax page, it's expected that a full screen not found page will show. The reason pressing back leads to the workspace list page is because a Navigation.dismissModal is called, which closes the workspace details page.

https://github.com/Expensify/App/blob/5d25b40eab1416d2d67624a376099853a2b6af86/src/pages/workspace/AccessOrNotFoundWrapper.tsx#L88-L97

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

shouldShowFullScreenFallback is true if the feature is disabled or the policy is not accessible. https://github.com/Expensify/App/blob/5d25b40eab1416d2d67624a376099853a2b6af86/src/pages/workspace/AccessOrNotFoundWrapper.tsx#L169

I think we should only close the workspace detail page if the policy is not accessible. To do that, we need to pass both isFeatureEnabled and isPolicyNotAccessible to PageNotFoundFallback and remove the shouldShowFullScreenFallback props and instead, add it as a local variable in PageNotFoundFallback.

isFeatureEnabled={isFeatureEnabled}
isPolicyNotAccessible={isPolicyNotAccessible}

Then, in PageNotFoundCallback, https://github.com/Expensify/App/blob/5d25b40eab1416d2d67624a376099853a2b6af86/src/pages/workspace/AccessOrNotFoundWrapper.tsx#L88-L98

only use dismissModal if the policy is not accessible. If the feature is disabled, then we will just go back.

const shouldShowFullScreenFallback = !isFeatureEnabled || isPolicyNotAccessible;
onBackButtonPress={() => {
    if (isPolicyNotAccessible) {
        Navigation.dismissModal();
        return;
    }
    Navigation.goBack(policyID && !isMoneyRequest ? ROUTES.WORKSPACE_PROFILE.getRoute(policyID) : undefined);
}}
melvin-bot[bot] commented 1 week ago

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

melvin-bot[bot] commented 1 week ago

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

mananjadhav commented 1 week ago

Got assigned today. Will review the proposal.

mananjadhav commented 1 week ago

I think @bernhardoj's proposal looks good. We'll need to check if it exists for other pages such as "Tags", etc.

🎀 👀 🎀 C+ reviewed.

melvin-bot[bot] commented 1 week ago

Triggered auto assignment to @madmax330, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

bernhardoj commented 1 week ago

PR is ready cc: @mananjadhav

mananjadhav commented 1 week ago

Thanks, I'll review and test by tomorrow.

melvin-bot[bot] commented 2 days ago

Reviewing label has been removed, please complete the "BugZero Checklist".

melvin-bot[bot] commented 2 days ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.53-1 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-11-01. :confetti_ball:

For reference, here are some details about the assignees on this issue:

melvin-bot[bot] commented 2 days ago

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed: