Skip to content
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

[HOLD for payment 2024-05-02] [$250] Workspace features - App shows two not here pages when opening inaccessible feature page #39092

Closed
2 of 6 tasks
lanitochka17 opened this issue Mar 27, 2024 · 24 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@lanitochka17
Copy link

lanitochka17 commented Mar 27, 2024

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.57-2
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.new.expensify.com.
  2. Go to feature page of a workspace in which user is not a member. (https://staging.new.expensify.com/settings/workspaces/CE183C61DF23465B/distance-rates
    )

Expected Result:

App will show not here page in full screen

Actual Result:

App shows not here page on the left and right

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

Bug6428991_1711560411823!Screenshot_2024-03-28_at_01 24 26

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01a372bbcef3dbf2a7
  • Upwork Job ID: 1773511214615310336
  • Last Price Increase: 2024-03-29
  • Automatic offers:
    • alitoshmatov | Reviewer | 0
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Mar 27, 2024
Copy link

melvin-bot bot commented Mar 27, 2024

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

@lanitochka17
Copy link
Author

@greg-schroeder 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

@lanitochka17
Copy link
Author

We think that this bug might be related to #wave-control

@Krishna2323
Copy link
Contributor

Krishna2323 commented Mar 27, 2024

Proposal

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

Workspace features - App shows two not here pages when opening inaccessible feature page

What is the root cause of that problem?

We are using NotFoundPage inside PaidPolicyAccessOrNotFoundComponent & AdminPolicyAccessOrNotFoundComponent. We need to use FullPageNotFoundView.

return <NotFoundPage onBackButtonPress={() => Navigation.goBack(ROUTES.WORKSPACE_PROFILE.getRoute(props.policyID))} />;

return <NotFoundPage onBackButtonPress={() => Navigation.goBack(ROUTES.WORKSPACE_PROFILE.getRoute(props.policyID))} />;

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

We need to use FullPageNotFoundView with shouldShow & shouldForceFullScreen just like we don in FeatureEnabledAccessOrNotFoundComponent.

Pseudo-code:

<FullPageNotFoundView
    shouldShow={shouldShowNotFoundPage}
    shouldForceFullScreen=
    onBackButtonPress={() => Navigation.goBack(ROUTES.WORKSPACE_PROFILE.getRoute(props.policyID))}
/>

There might be few more similar bugs, will try to find and fix those as well.

Optional: We might only want to do this in PaidPolicyAccessOrNotFoundComponent only.

Result

@Krishna2323
Copy link
Contributor

Proposal updated

  • Added references

@greg-schroeder greg-schroeder changed the title Workspace features - App shows two not here pages when opening inaccessible feature page [$250] Workspace features - App shows two not here pages when opening inaccessible feature page Mar 29, 2024
Copy link

melvin-bot bot commented Mar 29, 2024

⚠️ Could not update price automatically because there is no linked Upwork Job ID. The BZ team member will need to update the price manually in Upwork.

@greg-schroeder greg-schroeder added the External Added to denote the issue can be worked on by a contributor label Mar 29, 2024
Copy link

melvin-bot bot commented Mar 29, 2024

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

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

melvin-bot bot commented Mar 29, 2024

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

@nkdengineer
Copy link
Contributor

nkdengineer commented Mar 29, 2024

Proposal

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

App shows not here page on the left and right

What is the root cause of that problem?

In here and here, we only show the NotFoundPage which will cover only the main part of the screen, not the left WorkspaceInitialPage.

The reason for that is because, if the user has access to the policy, they have access to the WorkspaceInitialPage too, just not the specific workspace page in the main UI (because that user is not and admin or the workspace is not a paid one). So it makes sense to show NotFound page only in the main UI so the user could still navigate to other accessible workspace tabs if they want to. We can also see that our intention was to navigate to the workspace profile page of that workspace in onBackButtonPress (see here), so we are expecting here that the user access to the workspace already.

But this is not always true, there're scenario where the user don't actually have access to that workspace at all (non-existent workspace or the user is not a member of that workspace). In this case the user won't see the left- WorkspaceInitialPage too, so it shows as 2 NotFoundPages.

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

We should make clear of 2 scenarios:

  1. If the user doesn't have access to the workspace: We need to show the FullPageNotFoundView that covers the full screen (not 2 not found pages as we do now), and when the user clicks back press, we should goBack with the workspace list pages as fallback (or home screen, depending on team's decision). We can't goBack with workspace profile page as we're doing here, because the user won't have access even to that profile page so that will be another not found screen when the user clicks on back press.
  2. If the user has access to the workspace, but not the specific page they're trying to get in: Show not found page in the main UI as currently (the left- WorkspaceInitialPage should still be accessibile)

We can do that by updating here to

if (shouldShowNotFoundPage) {
    const isPolicyNotAccessible = isEmptyObject(props.policy) || !props.policy?.id;

    if (isPolicyNotAccessible) {
        return <FullPageNotFoundView
            shouldShow
            shouldForceFullScreen
            onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_WORKSPACES)}
        />
    }
    return <NotFoundPage onBackButtonPress={() => Navigation.goBack(ROUTES.WORKSPACE_PROFILE.getRoute(props.policyID))} />;
}

isPolicyNotAccessible is same condition being checked in here, we can extract out and reuse.

(Do the same in PaidPolicyAccessOrNotFoundComponent, or in FeatureEnabledAccessOrNotFoundComponent too if we want)

What alternative solutions did you explore? (Optional)

We can show FullPageNotFoundView for both scenarios listed above, but importantly we need to goBack to the correct page. Either always go back to ROUTES.SETTINGS_WORKSPACES or go back to ROUTES.SETTINGS_WORKSPACES if workspace is not accessibile, and to ROUTES.WORKSPACE_PROFILE.getRoute(props.policyID) if workspace is accessible. If not there'll be a bug when doing back press.

because the user won't have access even to that profile page so that will be another not found screen when the user clicks on back press.

@melvin-bot melvin-bot bot added the Overdue label Apr 1, 2024
@greg-schroeder
Copy link
Contributor

Pending proposal review @alitoshmatov

@melvin-bot melvin-bot bot removed the Overdue label Apr 3, 2024
@alitoshmatov
Copy link
Contributor

@Krishna2323 Thank you for your proposal, you solution causes to show not fullscreen found page always even though user has access to workspace

@alitoshmatov
Copy link
Contributor

@nkdengineer Thank you for your proposal, Your RCA is correct and your solution looks good. I think going back to workspaces list is better option when user does not have access to the workspace

We can go with @nkdengineer 's proposal

C+ reviewed 🎀 👀 🎀

Copy link

melvin-bot bot commented Apr 3, 2024

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

@greg-schroeder
Copy link
Contributor

Bump @youssef-lr on contributor selection :)

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 6, 2024
@youssef-lr
Copy link
Contributor

LGTM as well!

Copy link

melvin-bot bot commented Apr 6, 2024

📣 @alitoshmatov 🎉 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 Apr 6, 2024

📣 @nkdengineer You have been assigned to this job!
Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs!
Keep in mind: Code of Conduct | Contributing 📖

@greg-schroeder
Copy link
Contributor

Linked PR is in review, needs @alitoshmatov to take a look as a next step!

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Apr 25, 2024
@melvin-bot melvin-bot bot changed the title [$250] Workspace features - App shows two not here pages when opening inaccessible feature page [HOLD for payment 2024-05-02] [$250] Workspace features - App shows two not here pages when opening inaccessible feature page Apr 25, 2024
Copy link

melvin-bot bot commented Apr 25, 2024

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Apr 25, 2024
Copy link

melvin-bot bot commented Apr 25, 2024

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

If no regressions arise, payment will be issued on 2024-05-02. 🎊

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

Copy link

melvin-bot bot commented Apr 25, 2024

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:

  • [@alitoshmatov] The PR that introduced the bug has been identified. Link to the PR:
  • [@alitoshmatov] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@alitoshmatov] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@alitoshmatov] Determine if we should create a regression test for this bug.
  • [@alitoshmatov] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@greg-schroeder] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@alitoshmatov
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR: Feat/categories main page #36324
  • The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment: https://github.com/Expensify/App/pull/36324/files#r1585896057
  • A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: No need
  • Determine if we should create a regression test for this bug. No need

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels May 1, 2024
@greg-schroeder
Copy link
Contributor

@alitoshmatov paid
@nkdengineer manual offer sent, i'll pay you right away as soon as you accept!

no regression test per C+, closing accordingly.

@nkdengineer
Copy link
Contributor

@greg-schroeder I accepted the offer 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
Archived in project
Development

No branches or pull requests

6 participants