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-06] [$250] Workspace - Name RHP stays open while not found view is loading #40488

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

Comments

@lanitochka17
Copy link

lanitochka17 commented Apr 18, 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.63-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by:
Slack conversation:

Issue found when executing PR #36409

Action Performed:

  1. Navigate to staging.new.expensify.com
  2. Create a workspace
  3. Go to workspace settings > Profile > Name
  4. While the RHP is open click on URL and change the workspace ID to something invalid
  5. Navigate to it (e.g https://staging.new.expensify.com/settings/workspaces/<invalid
    ID>/profile)

Expected Result:

The profile name RHP should close while not found view is loading

Actual Result:

The profile name RHP first closes and then re appears while the not found view is loading

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

Bug6453768_1713453751763.Screen_Recording_20240418_181850_Chrome.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~012247865ed0caacd0
  • Upwork Job ID: 1782481496034230272
  • Last Price Increase: 2024-04-22
  • Automatic offers:
    • Pujan92 | Reviewer | 0
    • nkdengineer | Contributor | 0
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 18, 2024
Copy link

melvin-bot bot commented Apr 18, 2024

Triggered auto assignment to @abekkala (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
Copy link
Author

@abekkala 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-collect - Release 1

@Nodebrute
Copy link
Contributor

Nodebrute commented Apr 19, 2024

Proposal

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

Name RHP stays open while not found view is loading

What is the root cause of that problem?

After testing, it appears that this error is not limited to the profile page; it also occurs on the description page. There is currently no logic implemented to handle the not-found page scenario.

<ScreenWrapper
includeSafeAreaPaddingBottom={false}
shouldEnableMaxHeight
testID={WorkspaceProfileDescriptionPage.displayName}
>
<HeaderWithBackButton
title={translate('workspace.editor.descriptionInputLabel')}
onBackButtonPress={() => Navigation.goBack()}
/>

<ScreenWrapper
includeSafeAreaPaddingBottom={false}
shouldEnableMaxHeight
testID={WorkspaceNamePage.displayName}
>
<HeaderWithBackButton
title={translate('workspace.editor.nameInputLabel')}
onBackButtonPress={() => Navigation.goBack()}
/>

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

We can implement it similarly to how we're handling the currency selector in the workspace.

<FullPageNotFoundView
onBackButtonPress={PolicyUtils.goBackFromInvalidPolicy}
onLinkPress={PolicyUtils.goBackFromInvalidPolicy}
shouldShow={(isEmptyObject(policy) && !isLoadingReportData) || !PolicyUtils.isPolicyAdmin(policy) || PolicyUtils.isPendingDeletePolicy(policy)}
subtitleKey={isEmptyObject(policy) ? undefined : 'workspace.common.notAuthorized'}
>

We can do something like this

 <FullPageNotFoundView
onBackButtonPress={PolicyUtils.goBackFromInvalidPolicy}
  onLinkPress={PolicyUtils.goBackFromInvalidPolicy}
  shouldShow={(isEmptyObject(policy))|| !PolicyUtils.isPolicyAdmin(policy) || PolicyUtils.isPendingDeletePolicy(policy)}
 subtitleKey={isEmptyObject(policy) ? undefined : 'workspace.common.notAuthorized'}
            >

Result

Screen.Recording.2024-04-19.at.9.41.31.AM.mov

What alternative solutions did you explore? (Optional)

We need to test other areas to see if the bug occurs elsewhere as well.
Regarding the loading indicator, we can utilize withPolicyAndFullscreenLoading if we decide to include it. However, currently, we're fine without it.

@melvin-bot melvin-bot bot added the Overdue label Apr 22, 2024
@abekkala abekkala added the External Added to denote the issue can be worked on by a contributor label Apr 22, 2024
@melvin-bot melvin-bot bot changed the title Workspace - Name RHP stays open while not found view is loading [$250] Workspace - Name RHP stays open while not found view is loading Apr 22, 2024
Copy link

melvin-bot bot commented Apr 22, 2024

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

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

melvin-bot bot commented Apr 22, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Apr 22, 2024
@abekkala
Copy link
Contributor

@Pujan92 we have received a proposal for this one

@nkdengineer
Copy link
Contributor

Proposal

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

The profile name RHP first closes and then re appears while the not found view is loading

What is the root cause of that problem?

We don't have any logic to guard the WorkspaceNamePage here against unauthorized access.

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

This is a common use cases for which a dedicated wrapper AdminPolicyAccessOrNotFoundWrapper has been built. It was used everywhere in the same RHP cases like WorkspaceTagsSettingsPage, WorkspaceCreateTaxPage, ...

Not only does it handle showing the correct NotFound based on user's access, but it also has correct goBack logic when we click on back button here (if the workspace is accessible, go back to the workspace profile page, otherwise go to workspace list page). Which will not be available if we use a duplicated FullPageNotFoundView ourselves.

We should use AdminPolicyAccessOrNotFoundWrapper it in WorkspaceNamePage and other pages that are missing it. If we need to customize the subtitle, onLinkPress or other props, we can pass custom param to AdminPolicyAccessOrNotFoundComponent and in AdminPolicyAccessOrNotFoundComponent pass it to the underlying not found page.

For example, if we want to customize to use workspace.common.notAuthorized as the subtitle if policy exists but the user doesn't have admin access, like here, we can add a subtitleKey prop to AdminPolicyAccessOrNotFoundWrapper and pass it to FullPageNotFoundView and NotFoundPage inside. Or we can even make this behavior (custom message if policy exists but don't have access) a default behavior of AdminPolicyAccessOrNotFoundWrapper, and don't need the custom prop.

(Besides the above, we might need to use withPolicyAndFullscreenLoading to wrap the WorkspaceNamePage similar to other pages that use AdminPolicyAccessOrNotFoundWrapper)

What alternative solutions did you explore? (Optional)

For pages that currently use custom FullPageNotFoundView instead of the standardized AdminPolicyAccessOrNotFoundWrapper, like WorkspaceProfileCurrencyPage, we can optionally refactor to use AdminPolicyAccessOrNotFoundWrapper

@Pujan92
Copy link
Contributor

Pujan92 commented Apr 23, 2024

Thanks for the proposals.

Indeed, AdminPolicyAccessOrNotFoundWrapper is the wrapper created specifically for this purpose. Using AdminPolicyAccessOrNotFoundWrapper and customizing it for the subtitle and other required fields(if any) makes more sense to me. Considering that, I am inclined to select @nkdengineer 's proposal over @Nodebrute's proposal.
For all workspace pages add AdminPolicyAccessOrNotFoundWrapper where it is missing and replace FullPageNotFoundView with AdminPolicyAccessOrNotFoundWrapper to make it consistent across all workspace related pages.

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Apr 23, 2024

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

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

melvin-bot bot commented Apr 23, 2024

📣 @Pujan92 🎉 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 23, 2024

📣 @nkdengineer 🎉 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 📖

@nkdengineer
Copy link
Contributor

I'll raise PR soon

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production labels Apr 29, 2024
@melvin-bot melvin-bot bot changed the title [$250] Workspace - Name RHP stays open while not found view is loading [HOLD for payment 2024-05-06] [$250] Workspace - Name RHP stays open while not found view is loading Apr 29, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Apr 29, 2024
Copy link

melvin-bot bot commented Apr 29, 2024

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

Copy link

melvin-bot bot commented Apr 29, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.67-7 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-06. 🎊

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

Copy link

melvin-bot bot commented Apr 29, 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:

  • [@Pujan92] The PR that introduced the bug has been identified. Link to the PR:
  • [@Pujan92] 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:
  • [@Pujan92] 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:
  • [@Pujan92] Determine if we should create a regression test for this bug.
  • [@Pujan92] 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.
  • [@abekkala] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@abekkala
Copy link
Contributor

abekkala commented Apr 30, 2024

PAYMENT SUMMARY FOR MAY 06

@rlinoz
Copy link
Contributor

rlinoz commented May 3, 2024

friendly bump @Pujan92

@Pujan92
Copy link
Contributor

Pujan92 commented May 4, 2024

I think a checklist is not needed here as none of the specific PR caused this.

@Pujan92
Copy link
Contributor

Pujan92 commented May 4, 2024

Regression Test Steps

  1. Goto your workspace -> Profile
  2. Click on the name which opens the RHP for editing the name
  3. In the URL modify the workspace id with any invalid one and hit enter
  4. Verify that not found view is displayed

@abekkala
Copy link
Contributor

abekkala commented May 6, 2024

@Pujan92 please accept the offer in Upwork and I can process payment - thanks!

@abekkala
Copy link
Contributor

abekkala commented May 6, 2024

@nkdengineer payment sent and contract ended - thank you! 🎉

@Pujan92
Copy link
Contributor

Pujan92 commented May 6, 2024

@abekkala Accepted, Thanks!

@abekkala
Copy link
Contributor

abekkala commented May 7, 2024

@Pujan92 payment sent and contract ended - thank you!

@abekkala abekkala closed this as completed May 7, 2024
Copy link

melvin-bot bot commented May 7, 2024

@rlinoz @abekkala Be sure to fill out the Contact List!

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. External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
No open projects
Archived in project
Development

No branches or pull requests

6 participants