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-07-17] [$125] Invoice-User B's workspace appears in User A's workspace list after paying invoice as business #44811

Closed
6 tasks done
izarutskaya opened this issue Jul 4, 2024 · 35 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

@izarutskaya
Copy link

izarutskaya commented Jul 4, 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.4-0
Reproducible in staging?: Y
Reproducible in production?: N
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team

Action Performed:

Precondition:

  • User A and User B have their own workspaces.
  1. Go to staging.new.expensify.com
  2. [User A] Send invoice to User B.
  3. [User B] Go to invoice chat.
  4. [User B] Click on the pay button > Pay as a business > Pay elsewhere.
  5. [User A] Go to Account settings > Workspaces.

Expected Result:

User B's workspace will not appear in User A's workspace list.

Actual Result:

User B's workspace appears in User A's workspace list after paying invoice as a business.

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

Bug6532630_1720057513028.20240704_094220.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~011ae1abcb3755a5ef
  • Upwork Job ID: 1808845128155915041
  • Last Price Increase: 2024-07-04
Issue OwnerCurrent Issue Owner: @kevinksullivan
@izarutskaya izarutskaya added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. DeployBlocker Indicates it should block deploying the API labels Jul 4, 2024
Copy link

melvin-bot bot commented Jul 4, 2024

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

Copy link

melvin-bot bot commented Jul 4, 2024

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

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Jul 4, 2024
Copy link
Contributor

github-actions bot commented Jul 4, 2024

👋 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.

@izarutskaya
Copy link
Author

@kevinksullivan 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.

@izarutskaya
Copy link
Author

We think this issue might be related to the #vip-vsb.

@izarutskaya
Copy link
Author

Production

image (2)

@flodnv
Copy link
Contributor

flodnv commented Jul 4, 2024

@cristipaval I think you've been working on this, can you take a look please?

Discussion here: https://expensify.slack.com/archives/C01GTK53T8Q/p1720088829168919?thread_ts=1720087115.875599&cid=C01GTK53T8Q

@cristipaval
Copy link
Contributor

The App needs to filter out the workspaces in which the user has no role. By the time when we decided to save public info about receiver policies in the Onyx for all participants, the App was filtering those workspaces out (see this).

@nyomanjyotisa
Copy link
Contributor

Proposal

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

Invoice-User B's workspace appears in User A's workspace list after paying invoice as business

What is the root cause of that problem?

There is the receiver policy stored on the Onyx, but only with avatar and name fields
Screenshot 2024-07-04 at 18 52 51

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

We can filter out the receiver policy by excluding policies that don't have any other fields

Based on this comment we can filter out the workspaces in which the user has no role by modifying this function to add !!policy?.role

function shouldShowPolicy(policy: OnyxEntry<Policy>, isOffline: boolean): 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) &&
        !!policy?.role
    );
}

What alternative solutions did you explore? (Optional)

@cristipaval
Copy link
Contributor

The solution looks good to me but I think that the bounty for this issue should be 125 USD, given that I also posted the solution in plain English here

@cristipaval cristipaval added the External Added to denote the issue can be worked on by a contributor label Jul 4, 2024
@melvin-bot melvin-bot bot changed the title Invoice-User B's workspace appears in User A's workspace list after paying invoice as business [$250] Invoice-User B's workspace appears in User A's workspace list after paying invoice as business Jul 4, 2024
Copy link

melvin-bot bot commented Jul 4, 2024

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

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

melvin-bot bot commented Jul 4, 2024

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

@cristipaval cristipaval changed the title [$250] Invoice-User B's workspace appears in User A's workspace list after paying invoice as business [$125] Invoice-User B's workspace appears in User A's workspace list after paying invoice as business Jul 4, 2024
Copy link

melvin-bot bot commented Jul 4, 2024

Upwork job price has been updated to $125

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

melvin-bot bot commented Jul 10, 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:

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

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Jul 15, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-07-17] [$125] Invoice-User B's workspace appears in User A's workspace list after paying invoice as business [HOLD for payment 2024-07-22] [HOLD for payment 2024-07-17] [$125] Invoice-User B's workspace appears in User A's workspace list after paying invoice as business Jul 15, 2024
Copy link

melvin-bot bot commented Jul 15, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.6-8 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-07-22. 🎊

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

Copy link

melvin-bot bot commented Jul 15, 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:

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jul 16, 2024
@nyomanjyotisa
Copy link
Contributor

I believe the payment was already due as of 2024-07-17

@melvin-bot melvin-bot bot added the Overdue label Jul 18, 2024
@cristipaval cristipaval changed the title [HOLD for payment 2024-07-22] [HOLD for payment 2024-07-17] [$125] Invoice-User B's workspace appears in User A's workspace list after paying invoice as business [HOLD for payment 2024-07-17] [$125] Invoice-User B's workspace appears in User A's workspace list after paying invoice as business Jul 19, 2024
@cristipaval
Copy link
Contributor

I believe the payment was already due as of 2024-07-17

You're right. @kevinksullivan could you please handle the payments? 🙏

Copy link

melvin-bot bot commented Jul 19, 2024

@eVoloshchak, @cristipaval, @kevinksullivan, @nyomanjyotisa Whoops! This issue is 2 days overdue. Let's get this updated quick!

@kevinksullivan
Copy link
Contributor

Offer sent to @nyomanjyotisa . @eVoloshchak can you complete the checklist please?

@melvin-bot melvin-bot bot removed the Overdue label Jul 19, 2024
@kevinksullivan
Copy link
Contributor

Payment summary:

@nyomanjyotisa
Copy link
Contributor

Offer accepted

@kevinksullivan
Copy link
Contributor

Paid. Waiting on checklist @eVoloshchak

@melvin-bot melvin-bot bot added the Overdue label Jul 22, 2024
@eVoloshchak eVoloshchak mentioned this issue Jul 22, 2024
50 tasks
@eVoloshchak
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR: [Wave 8] Ideal nav  #33280
  • 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/33280/files#r1686570145
  • 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: I don't think an additional discussion is needed as this is a minor edge case

Regression Test Proposal

Prerequisite: User A and User B have their own workspaces.

  1. [User A] Send invoice to User B.
  2. [User B] Go to invoice chat.
  3. [User B] Click on the pay button > Pay as a business > Pay elsewhere.
  4. [User A] Go to Account settings > Workspaces.
  5. Verify that User B's workspace does not appear in the workspace list

Do we agree 👍 or 👎

@JmillsExpensify
Copy link

$150 approved for @eVoloshchak

Copy link

melvin-bot bot commented Jul 23, 2024

@eVoloshchak, @cristipaval, @kevinksullivan, @nyomanjyotisa Whoops! This issue is 2 days overdue. Let's get this updated quick!

Copy link

melvin-bot bot commented Jul 25, 2024

@eVoloshchak, @cristipaval, @kevinksullivan, @nyomanjyotisa Eep! 4 days overdue now. Issues have feelings too...

@kevinksullivan
Copy link
Contributor

adding regression test and closing out!

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

No branches or pull requests

9 participants