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-29] [Held] [$250] Invoices - Workspace settings can be opened from "workspace" link when workspace is deleted #49093

Closed
6 tasks done
IuliiaHerets opened this issue Sep 12, 2024 · 58 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 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Sep 12, 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.33-1
Reproducible in staging?: Y
Reproducible in production?: N/A - new feature, doesn't exist in prod
Issue was found when executing this PR: #48275
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team

Action Performed:

Precondition:

  • User B has no workspace.
  1. Go to staging.new.expensify.com
  2. {User A] Send an invoice to User B.
  3. [User B] Pay the invoice using Pay as a business option.
  4. [User B] Delete the workspace.
  5. {User B] Go to invoice chat.
  6. [User B] Click on the "workspace" link in Expensify message.

Expected Result:

The link should lead to not here page because workspace is deleted.

Actual Result:

The link can open workspace settings page and Members tab leads to not here page.

Workaround:

Unknown

Platforms:

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6601039_1726148441534.20240912_213050.1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021834598579747458653
  • Upwork Job ID: 1834598579747458653
  • Last Price Increase: 2024-09-13
  • Automatic offers:
    • ishpaul777 | Contributor | 104008088
    • gijoe0295 | Contributor | 104027162
Issue OwnerCurrent Issue Owner: @joekaufmanexpensify
@IuliiaHerets IuliiaHerets added Bug Something is broken. Auto assigns a BugZero manager. DeployBlocker Indicates it should block deploying the API labels Sep 12, 2024
Copy link

melvin-bot bot commented Sep 12, 2024

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

@melvin-bot melvin-bot bot added the Daily KSv2 label Sep 12, 2024
@IuliiaHerets
Copy link
Author

We think that this bug might be related to #vip-bills

@iwiznia iwiznia removed the DeployBlocker Indicates it should block deploying the API label Sep 12, 2024
@iwiznia
Copy link
Contributor

iwiznia commented Sep 12, 2024

@m-natarajan m-natarajan added the DeployBlockerCash This issue or pull request should block deployment label Sep 12, 2024
Copy link

melvin-bot bot commented Sep 12, 2024

Triggered auto assignment to @srikarparsi (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@luacmartins
Copy link
Contributor

@IuliiaHerets I think the uploaded video is incorrect. Can you please check?

@IuliiaHerets
Copy link
Author

@luacmartins fixed, sorry for this

@luacmartins
Copy link
Contributor

No problem. Thank you!

@luacmartins
Copy link
Contributor

This is also reproducible in prod if we just copy/paste the workspace link

@luacmartins luacmartins added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Sep 12, 2024
@rlinoz
Copy link
Contributor

rlinoz commented Sep 12, 2024

Just by having the workspace link in any chat the problem also happens in prod:

Screen.Recording.2024-09-12.at.14.46.18.mov

@IuliiaHerets
Copy link
Author

We can't pay the invoice using Pay as a business in prod, so I marked it as N/A - can't check on prod

@gijoe0295
Copy link
Contributor

gijoe0295 commented Sep 12, 2024

Edited by proposal-police: This proposal was edited at 2023-10-06T15:00:00Z.

Proposal

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

The link can open workspace settings page and Members tab leads to not here page.

What is the root cause of that problem?

After deleting the workspace, we still retain some workspace information to show the invoice report's avatars and name:

Screenshot 2024-09-13 at 01 27 59

These information is returned by OpenReport:

Screenshot 2024-09-13 at 01 28 52

The not found page condition here simply checks for empty/delete-pending policy:

return (
(!isEmptyObject(policy) && !PolicyUtils.isPolicyAdmin(policy) && !shouldShowNonAdmin) ||
(PolicyUtils.isPendingDeletePolicy(policy) && PolicyUtils.isPendingDeletePolicy(prevPolicy))
);

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

  1. We can add shouldShowPolicy to the shouldShowNotFoundPage above to filter these workspaces and prevent them from being accessed by URL:

App/src/libs/PolicyUtils.ts

Lines 180 to 187 in 7748eff

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)
);
}

This condition is also used in WorkspacesListPage to filter viewable workspace. This solution ensures if a workspace did not appear in the workspaces list, it should not be accessible via direct URL.

.filter((policy): policy is PolicyType => PolicyUtils.shouldShowPolicy(policy, !!isOffline))

  1. We also need to add the above filter to WorkspaceInitialPage and WorkspaceProfilePage:

const shouldShowNotFoundPage =

shouldShowNotFoundPage={policy === undefined}

  1. And modify the not found subtitle in those pages as well since they are assuming that only empty policies are deleted:

subtitleKey={isEmptyObject(policy) ? undefined : 'workspace.common.notAuthorized'}

subtitleKey={isEmptyObject(policy) ? undefined : 'workspace.common.notAuthorized'}

@joekaufmanexpensify joekaufmanexpensify added the External Added to denote the issue can be worked on by a contributor label Sep 13, 2024
@melvin-bot melvin-bot bot changed the title Invoices - Workspace settings can be opened from "workspace" link when workspace is deleted [$250] Invoices - Workspace settings can be opened from "workspace" link when workspace is deleted Sep 13, 2024
Copy link

melvin-bot bot commented Sep 13, 2024

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

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

Will retest today.

@joekaufmanexpensify
Copy link
Contributor

@gijoe0295 Did you have a chance to do this?

@ishpaul777
Copy link
Contributor

@gijoe0295 has asked some help from @fabioh8010, the investigation in ongoing #49509

@joekaufmanexpensify
Copy link
Contributor

Sounds good. TY!

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Monthly KSv2 labels Nov 22, 2024
@melvin-bot melvin-bot bot changed the title [Held] [$250] Invoices - Workspace settings can be opened from "workspace" link when workspace is deleted [HOLD for payment 2024-11-29] [Held] [$250] Invoices - Workspace settings can be opened from "workspace" link when workspace is deleted Nov 22, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Nov 22, 2024
Copy link

melvin-bot bot commented Nov 22, 2024

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

Copy link

melvin-bot bot commented Nov 22, 2024

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

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

Copy link

melvin-bot bot commented Nov 22, 2024

@ishpaul777 @joekaufmanexpensify @ishpaul777 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]

@joekaufmanexpensify
Copy link
Contributor

@ishpaul777 could you handle the checklist here?

@joekaufmanexpensify
Copy link
Contributor

As an fyi, I am OOO the rest of the week after today. Assuming the checklist is done by then, I will handle payment on Monday!

@ishpaul777
Copy link
Contributor

ishpaul777 commented Nov 30, 2024

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: https://github.com/Expensify/App/pull/38488/files#r1864457951

  • [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: not required

  • [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. - Not required because reproduction steps are far fetched, not a core or even usual flow, Real user rarely could have encountered it, One time issue Now its fixed

@melvin-bot melvin-bot bot added the Overdue label Dec 2, 2024
Copy link

melvin-bot bot commented Dec 2, 2024

@srikarparsi, @joekaufmanexpensify, @ishpaul777, @gijoe0295 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@joekaufmanexpensify
Copy link
Contributor

Just back from OOO. Will handle remaining steps today!

@melvin-bot melvin-bot bot removed the Overdue label Dec 2, 2024
@joekaufmanexpensify
Copy link
Contributor

Checklist is all set. We're good to pay.

@joekaufmanexpensify
Copy link
Contributor

joekaufmanexpensify commented Dec 2, 2024

We need to pay:

@joekaufmanexpensify
Copy link
Contributor

@gijoe0295 $250 sent and contract ended!

@joekaufmanexpensify
Copy link
Contributor

@ishpaul777 $250 sent and contract ended!

@joekaufmanexpensify
Copy link
Contributor

Upwork job closed

@joekaufmanexpensify
Copy link
Contributor

All set, thanks everyone!

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 Engineering External Added to denote the issue can be worked on by a contributor
Projects
Status: Done
Development

No branches or pull requests