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

[$250] Workspace list is opened when opening a WS share code without any access to it #51000

Open
3 of 8 tasks
izarutskaya opened this issue Oct 17, 2024 · 9 comments
Open
3 of 8 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Overdue

Comments

@izarutskaya
Copy link

izarutskaya commented Oct 17, 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: 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
Issue OwnerCurrent Issue Owner: @sobitneupane
@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/join?email=bernhard.josephus@gmail.com).

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!

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 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Overdue
Projects
None yet
Development

No branches or pull requests

5 participants