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-10-25] [$250] Invoice - Invoice room is not archived after deleting the workspace offline #49113

Closed
6 tasks done
IuliiaHerets opened this issue Sep 12, 2024 · 41 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

@IuliiaHerets
Copy link

IuliiaHerets commented Sep 12, 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.33-1
Reproducible in staging?: Y
Reproducible in production?: Y
Issue was found when executing this PR: #48275
Email or phone of affected tester (no customers): applausetester+kh010901@applause.expensifail.com
Issue reported by: Applause Internal Team

Action Performed:

Precondition:

  • User B has only one 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] Go offline.
  5. [User B] Delete the workspace.
  6. {User B] Go to invoice chat.

Expected Result:

The invoice chat should be archived after deleting the workspace offline.

Actual Result:

The invoice room is not archived after deleting the workspace offline.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6601022_1726146959362.20240912_210831.mp4

Add any screenshot/video evidence

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021841806197088184582
  • Upwork Job ID: 1841806197088184582
  • Last Price Increase: 2024-10-10
  • Automatic offers:
    • dukenv0307 | Reviewer | 104360901
Issue OwnerCurrent Issue Owner: @trjExpensify
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 12, 2024
Copy link

melvin-bot bot commented Sep 12, 2024

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

@IuliiaHerets
Copy link
Author

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

@IuliiaHerets
Copy link
Author

@dylanexpensify 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

@daledah
Copy link
Contributor

daledah commented Sep 12, 2024

Proposal

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

The invoice room is not archived after deleting the workspace offline.

What is the root cause of that problem?

When deleting workspaces, we choose what report to be archived here:

const reportsToArchive = Object.values(ReportConnection.getAllReports() ?? {}).filter(
(report) => report?.policyID === policyID && (ReportUtils.isChatRoom(report) || ReportUtils.isPolicyExpenseChat(report) || ReportUtils.isTaskReport(report)),
);

However, an invoice sent from user A will have policyID of A's WS, not of B's WS, so the condition report?.policyID === policyID is false, hence the chat room not archived.

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

We should add logic to include invoice chat sent from others as well, like what we did here

Update this:

(report) => report?.policyID === policyID && (ReportUtils.isChatRoom(report) || ReportUtils.isPolicyExpenseChat(report) || ReportUtils.isTaskReport(report)),

to:

(report) =>
            (report?.policyID === policyID || (report?.invoiceReceiver && 'policyID' in report?.invoiceReceiver && report?.invoiceReceiver.policyID == policyID)) &&
            (ReportUtils.isChatRoom(report) || ReportUtils.isPolicyExpenseChat(report) || ReportUtils.isTaskReport(report)),
    

What alternative solutions did you explore? (Optional)

Copy link

melvin-bot bot commented Sep 17, 2024

@dylanexpensify Huh... This is 4 days overdue. Who can take care of this?

@dylanexpensify
Copy link
Contributor

reviewing today!

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Sep 18, 2024
Copy link

melvin-bot bot commented Sep 23, 2024

@dylanexpensify Eep! 4 days overdue now. Issues have feelings too...

@dylanexpensify
Copy link
Contributor

@davidcardoza can you confirm if this is unexpected behavior?

@melvin-bot melvin-bot bot removed the Overdue label Sep 25, 2024
@davidcardoza
Copy link
Contributor

Do we archive workspace rooms after a workspace is delete? If yes, an invoice room should follow the same pattern.

Copy link

melvin-bot bot commented Sep 26, 2024

@dylanexpensify this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@melvin-bot melvin-bot bot added the Overdue label Sep 27, 2024
Copy link

melvin-bot bot commented Sep 30, 2024

@dylanexpensify Huh... This is 4 days overdue. Who can take care of this?

@davidcardoza
Copy link
Contributor

Any update on this issue?

Copy link

melvin-bot bot commented Oct 2, 2024

@dylanexpensify 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

@dylanexpensify
Copy link
Contributor

@davidcardoza sorry for delay, yes, we do archive rooms when a workspace is deleted, so agree we follow that logic here with invoice rooms.

@melvin-bot melvin-bot bot removed the Overdue label Oct 3, 2024
@dylanexpensify dylanexpensify added the External Added to denote the issue can be worked on by a contributor label Oct 3, 2024
@melvin-bot melvin-bot bot changed the title Invoice - Invoice room is not archived after deleting the workspace offline [$250] Invoice - Invoice room is not archived after deleting the workspace offline Oct 3, 2024
Copy link

melvin-bot bot commented Oct 3, 2024

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

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

melvin-bot bot commented Oct 3, 2024

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

Copy link

melvin-bot bot commented Oct 15, 2024

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

@dylanexpensify
Copy link
Contributor

Reassigning as I head to parental leave next week! Thanks Tom!

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Oct 18, 2024
@melvin-bot melvin-bot bot changed the title [$250] Invoice - Invoice room is not archived after deleting the workspace offline [HOLD for payment 2024-10-25] [$250] Invoice - Invoice room is not archived after deleting the workspace offline Oct 18, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 18, 2024
Copy link

melvin-bot bot commented Oct 18, 2024

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

Copy link

melvin-bot bot commented Oct 18, 2024

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

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

Copy link

melvin-bot bot commented Oct 18, 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:

  • [@dukenv0307] The PR that introduced the bug has been identified. Link to the PR:
  • [@dukenv0307] 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:
  • [@dukenv0307] 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:
  • [@dukenv0307] Determine if we should create a regression test for this bug.
  • [@dukenv0307] 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.
  • [@trjExpensify] 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 Oct 25, 2024
@trjExpensify
Copy link
Contributor

👋 checklist time!

@melvin-bot melvin-bot bot added the Overdue label Oct 28, 2024
@jasperhuangg
Copy link
Contributor

Awaiting checklist cc @dukenv0307

@trjExpensify
Copy link
Contributor

For Melv, agreed!

@melvin-bot melvin-bot bot removed the Overdue label Oct 29, 2024
@dukenv0307
Copy link
Contributor

BugZero Checklist:

  • The PR that introduced the bug has been identified. Link to the PR: N/A
  • 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: N/A
  • 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: N/A
  • Determine if we should create a regression test for this bug. Yes
  • 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.

Regression test:

  • Precondition:
  1. User B has a WS
  2. User A send an invoice to user B
  • Steps:
  1. User B pay using "Pay as a business" option
  2. User B go offline
  3. User B Delete the workspace.
  4. User B Go to Invoice chat
  5. Verify that: Invoice chat is archived

Do we 👍 or 👎

@dukenv0307
Copy link
Contributor

@jasperhuangg I completed the checklist

@melvin-bot melvin-bot bot added the Overdue label Oct 31, 2024
@trjExpensify
Copy link
Contributor

trjExpensify commented Nov 1, 2024

Payment summary as follows:

@melvin-bot melvin-bot bot removed the Overdue label Nov 1, 2024
@trjExpensify
Copy link
Contributor

@davidcardoza for the invoice project, are regression tests being handed over centrally to Applause to add to TestRail, and is one for deleting the workspace and archiving the invoice room included?

@davidcardoza
Copy link
Contributor

Yes, test cases to cover invoices were added to TestRail - https://github.com/Expensify/Expensify/issues/410043

There is not a test for deleting the workspace and archiving the invoice room. I can add it a new regression test to to it though. Before I spin up a new GH to add the QA test, is what's missing this:

  1. Deleting a workspace and archiving a room when there is an unpaid invoice in the room
  2. Deleting a workspace and archiving a room when there is an paid invoice in the room

Anything else?

@trjExpensify
Copy link
Contributor

I think that covers it!

@trjExpensify
Copy link
Contributor

Cool, so everyone is paid here now. I'll close it out!

Copy link

melvin-bot bot commented Nov 1, 2024

@trjExpensify @jasperhuangg 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. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
Status: Done
Development

No branches or pull requests

7 participants