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-11-20] [$250] Workspace list is opened when opening a WS share code without any access to it #51000

Closed
3 of 8 tasks
izarutskaya opened this issue Oct 17, 2024 · 27 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

@izarutskaya
Copy link

izarutskaya commented Oct 17, 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: 9.0.50-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?:
Found when validation PR #50875
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team

Action Performed:

Preconditions: Uninstall ND app. A Gmail user should be at it's own workspace share code page on web.

  1. Navigate to https://staging.new.expensify.com/
  2. Log in with a different, new Gmail user
  3. Open iOS "Camera" app
  4. Point the feed to the QR code
  5. Tap on the button to navigate to it

Expected Result:

I should be navigated to the "it's not here" page with an option to request access.

Actual Result:

Workspace list is opened when opening a WS share code without any access to it.

Workaround:

Unknown

Platforms:

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

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6637266_1729141374861.VQJQ8044.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021847411075396403416
  • Upwork Job ID: 1847411075396403416
  • Last Price Increase: 2024-10-18
@izarutskaya izarutskaya added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 17, 2024
Copy link

melvin-bot bot commented Oct 17, 2024

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

@izarutskaya
Copy link
Author

We think this issue might be related to the #collect project.

@bernhardoj
Copy link
Contributor

Proposal

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

WS list is opened when trying to open a WS shared link without any access.

What is the root cause of that problem?

The WS share link actually points to a WS join link (e.g., https://new.expensify.com/settings/workspaces/B6EEE0522721D212/[email protected]).

Opening the join link will send a join request and the user will be navigated to the WS list as expected.

MemberAction.inviteMemberToWorkspace(policyID, inviterEmail);
isJoinLinkUsed = true;
Navigation.isNavigationReady().then(() => {
if (isUnmounted.current) {
return;
}
navigateAfterJoinRequest();
});

The real problem here is that, the WS that we are trying to join doesn't appear on the WS list page. It's because we are filtering any policy that doesn't have role.

App/src/libs/PolicyUtils.ts

Lines 183 to 188 in 987ff1b

function shouldShowPolicy(policy: OnyxEntry<Policy>, isOffline: boolean, currentUserLogin: string | undefined): boolean {
return (
!!policy &&
(policy?.type !== CONST.POLICY.TYPE.PERSONAL || !!policy?.isJoinRequestPending) &&
(isOffline || policy?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE || Object.keys(policy.errors ?? {}).length > 0) &&
!!getPolicyRole(policy, currentUserLogin)

It's to solve this issue. A WS that we are trying to join only have this information.
image

Because there is no role information, the policy isn't shown.

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

If we look at the shouldShowPolicy condition, we already check for isJoinRequestPending to make sure any pending join WS still included on the list, but since the introduction of the role checking, this issue started to happen.

App/src/libs/PolicyUtils.ts

Lines 183 to 188 in 987ff1b

function shouldShowPolicy(policy: OnyxEntry<Policy>, isOffline: boolean, currentUserLogin: string | undefined): boolean {
return (
!!policy &&
(policy?.type !== CONST.POLICY.TYPE.PERSONAL || !!policy?.isJoinRequestPending) &&
(isOffline || policy?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE || Object.keys(policy.errors ?? {}).length > 0) &&
!!getPolicyRole(policy, currentUserLogin)

I think if a WS is pending join, then we can always show it, skipping the other conditions.

return (
    !!policy?.isJoinRequestPending ||
    (!!policy &&
        policy?.type !== CONST.POLICY.TYPE.PERSONAL &&
        (isOffline || policy?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE || Object.keys(policy.errors ?? {}).length > 0) &&
        !!getPolicyRole(policy, currentUserLogin))
);
image

@adelekennedy adelekennedy added the External Added to denote the issue can be worked on by a contributor label Oct 18, 2024
@melvin-bot melvin-bot bot changed the title Workspace list is opened when opening a WS share code without any access to it [$250] Workspace list is opened when opening a WS share code without any access to it Oct 18, 2024
Copy link

melvin-bot bot commented Oct 18, 2024

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

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

melvin-bot bot commented Oct 18, 2024

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

@sobitneupane
Copy link
Contributor

Thanks for the proposal @bernhardoj

Proposal from @bernhardoj looks good to me.

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Oct 21, 2024

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

@adelekennedy
Copy link

little bump @neil-marcellini for the internal review

@melvin-bot melvin-bot bot added the Overdue label Oct 23, 2024
Copy link

melvin-bot bot commented Oct 24, 2024

@sobitneupane, @neil-marcellini, @adelekennedy Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@neil-marcellini
Copy link
Contributor

Thanks for the proposal @bernhardoj

Proposal from @bernhardoj looks good to me.

🎀 👀 🎀 C+ reviewed

Wow nice solution, let's go with it.

@melvin-bot melvin-bot bot removed the Overdue label Oct 28, 2024
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 28, 2024
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Oct 29, 2024
@bernhardoj
Copy link
Contributor

PR is ready

cc: @sobitneupane

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Nov 13, 2024
@melvin-bot melvin-bot bot changed the title [$250] Workspace list is opened when opening a WS share code without any access to it [HOLD for payment 2024-11-20] [$250] Workspace list is opened when opening a WS share code without any access to it Nov 13, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Nov 13, 2024
Copy link

melvin-bot bot commented Nov 13, 2024

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

Copy link

melvin-bot bot commented Nov 13, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.60-3 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-11-20. 🎊

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

  • @sobitneupane requires payment through NewDot Manual Requests
  • @bernhardoj requires payment through NewDot Manual Requests

Copy link

melvin-bot bot commented Nov 13, 2024

@sobitneupane @adelekennedy @sobitneupane The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Nov 19, 2024
Copy link

melvin-bot bot commented Nov 20, 2024

Payment Summary

Upwork Job

BugZero Checklist (@adelekennedy)

  • I have verified the correct assignees and roles are listed above and updated the neccesary manual offers
  • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1847411075396403416/hired)
  • I have paid out the Upwork contracts or cancelled the ones that are incorrect
  • I have verified the payment summary above is correct

@bernhardoj
Copy link
Contributor

Requested in ND.

@adelekennedy
Copy link

BugZero Checklist:

  • [Contributor] Classify the bug:
Bug classification

Source of bug:

  • 1a. Result of the original design (eg. a case wasn't considered)
  • 1b. Mistake during implementation
  • 1c. Backend bug
  • 1z. Other:

Where bug was reported:

  • 2a. Reported on production
  • 2b. Reported on staging (deploy blocker)
  • 2c. Reported on both staging and production
  • 2d. Reported on a PR
  • 2z. Other:

Who reported the bug:

  • 3a. Expensify user
  • 3b. Expensify employee
  • 3c. Contributor
  • 3d. QA
  • 3z. Other:
  • [Contributor] 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:

  • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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:

  • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

Regression Test Proposal Template
  • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

    Link to issue:

Regression Test Proposal

Precondition:

Test:

Do we agree 👍 or 👎

@adelekennedy
Copy link

@sobitneupane for the checklist above

confirmed the payment summary above is correct

@JmillsExpensify
Copy link

$250 approved for @bernhardoj

@melvin-bot melvin-bot bot added the Overdue label Nov 25, 2024
@adelekennedy
Copy link

bump @sobitneupane

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Nov 25, 2024
Copy link

melvin-bot bot commented Nov 29, 2024

@sobitneupane, @neil-marcellini, @bernhardoj, @adelekennedy Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@adelekennedy
Copy link

bump @sobitneupane

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Nov 30, 2024
@sobitneupane
Copy link
Contributor

Regression Test Proposal

  1. Copy a workspace share link from user B where user A(new user) is not a member
  2. As user A, open the workspace share/join link copied in step 1.
  3. Verify that workspace list page is shown with a requested workspace in the list.

Do we agree 👍 or 👎

@sobitneupane
Copy link
Contributor

[Contributor] 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: #44836 (comment)

Copy link

melvin-bot bot commented Dec 4, 2024

@sobitneupane, @neil-marcellini, @bernhardoj, @adelekennedy Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot removed the Overdue label Dec 5, 2024
@tgolen
Copy link
Contributor

tgolen commented Dec 5, 2024

@adelekennedy Just a friendly bump to remind you to fill out the BZ checklist before closing these #51000 (comment)

@garrettmknight
Copy link
Contributor

$250 approved for @sobitneupane

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
None yet
Development

No branches or pull requests

8 participants