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 2025-01-02] [$250] Invoices - Invoice thread with RBR cannot be removed from LHN after dismissing error #54035

Closed
5 of 8 tasks
IuliiaHerets opened this issue Dec 12, 2024 · 17 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 Dec 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.75-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: Exp
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Device used: Mac 15.0 / Chrome
App Component: Money Requests

Action Performed:

  1. Go to staging.new.expensify.com
  2. Create a new workspace.
  3. Go to workspace settings > More features > Enable Invoices.
  4. Open FAB > Send invoice.
  5. Enter amount, select a recipient and proceed to confirmation page.
  6. Click Next.
  7. Enter any name.
  8. Enter google.com as the website.
  9. Click Send invoice.
  10. Click on the invoice preview in the invoice room.
  11. Dismiss the error in invoice thread.

Expected Result:

The invoice thread report with RBR will be dismissed after dismissing the error.

Actual Result:

The invoice thread report with RBR is not dismissed after dismissing the error.
There is no way to remove the report with RBR from LHN.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6692179_1734008548702.20241212_205120.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021868536648932872772
  • Upwork Job ID: 1868536648932872772
  • Last Price Increase: 2024-12-16
Issue OwnerCurrent Issue Owner: @kadiealexander
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Dec 12, 2024
Copy link

melvin-bot bot commented Dec 12, 2024

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

Closed by mistake

@IuliiaHerets IuliiaHerets reopened this Dec 12, 2024
@bernhardoj
Copy link
Contributor

bernhardoj commented Dec 12, 2024

Edited by proposal-police: This proposal was edited at 2024-12-12 15:21:59 UTC.

Proposal

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

Failed invoice when the error is closed doesn't delete the invoice.

What is the root cause of that problem?

We already have a logic to delete the transaction if the transaction pending action is ADD when closing the error.

onClose={() => {
if (!transaction?.transactionID && linkedTransactionID === '-1') {
return;
}
if (transaction?.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD) {
if (chatReport?.reportID && ReportUtils.getAddWorkspaceRoomOrChatReportErrors(chatReport)) {
Report.navigateToConciergeChatAndDeleteReport(chatReport.reportID, true, true);
return;
}
if (parentReportAction) {
IOU.cleanUpMoneyRequest(transaction?.transactionID ?? linkedTransactionID, parentReportAction, true);
return;
}
}

However, when the invoice fails, we clear the pending action.

App/src/libs/actions/IOU.ts

Lines 1381 to 1382 in d56dfec

errors: ErrorUtils.getMicroSecondOnyxErrorWithTranslationKey('iou.error.genericCreateInvoiceFailureMessage'),
pendingAction: null,

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

We shouldn't clear the pending action when fails, only when success, just like other money request cases. So, remove the pending action here.

App/src/libs/actions/IOU.ts

Lines 1381 to 1384 in d56dfec

errors: ErrorUtils.getMicroSecondOnyxErrorWithTranslationKey('iou.error.genericCreateInvoiceFailureMessage'),
pendingAction: null,
pendingFields: clearedPendingFields,
},

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

We can create a test for buildOnyxDataForInvoice to make sure the failure data for the optimistic transaction doesn't have the pendingAction: null. But I think it's kinda pointless because we are testing a constant thing, so better testing might be testing the sendInvoice API and giving it a wrong param and making sure the transaction still has the pending action.

@kadiealexander kadiealexander added the External Added to denote the issue can be worked on by a contributor label Dec 16, 2024
@melvin-bot melvin-bot bot changed the title Invoices - Invoice thread with RBR cannot be removed from LHN after dismissing error [$250] Invoices - Invoice thread with RBR cannot be removed from LHN after dismissing error Dec 16, 2024
Copy link

melvin-bot bot commented Dec 16, 2024

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

@melvin-bot melvin-bot bot added Overdue Help Wanted Apply this label when an issue is open to proposals by contributors labels Dec 16, 2024
Copy link

melvin-bot bot commented Dec 16, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Dec 16, 2024
@mollfpr
Copy link
Contributor

mollfpr commented Dec 16, 2024

The proposal from @bernhardoj looks good to me!

🎀 👀 🎀 C+ reviewed!

Copy link

melvin-bot bot commented Dec 16, 2024

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

@marcochavezf
Copy link
Contributor

Hey @mollfpr, thanks for the review! Assigning @bernhardoj 🚀

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

PR is ready

cc: @mollfpr

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Dec 26, 2024
@melvin-bot melvin-bot bot changed the title [$250] Invoices - Invoice thread with RBR cannot be removed from LHN after dismissing error [HOLD for payment 2025-01-02] [$250] Invoices - Invoice thread with RBR cannot be removed from LHN after dismissing error Dec 26, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Dec 26, 2024
Copy link

melvin-bot bot commented Dec 26, 2024

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

Copy link

melvin-bot bot commented Dec 26, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.78-6 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 2025-01-02. 🎊

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

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

Copy link

melvin-bot bot commented Dec 26, 2024

@mollfpr @kadiealexander @mollfpr 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 Jan 2, 2025
Copy link

melvin-bot bot commented Jan 2, 2025

Payment Summary

Upwork Job

BugZero Checklist (@kadiealexander)

  • 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/1868536648932872772/hired)
  • I have paid out the Upwork contracts or cancelled the ones that are incorrect
  • I have verified the payment summary above is correct

@melvin-bot melvin-bot bot added the Overdue label Jan 6, 2025
@kadiealexander
Copy link
Contributor

@mollfpr please don't forget the checklist!

@mollfpr
Copy link
Contributor

mollfpr commented Jan 6, 2025

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 (eg. bug slipped through the normal regression and PR testing process on staging)
  • 2b. Reported on staging (eg. found during regression or PR testing)
  • 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/40015/files#r1903714846

  • [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 a critical issue.

  • [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.

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

    Link to issue: https://github.com/Expensify/Expensify/issues/457949

Regression Test Proposal

Precondition:

Test:

  1. Send an invoice to any user with an invalid website (e.g., https://google.com)
  2. Verify the send invoice fails
  3. Open the invoice thread
  4. Dismiss the error
  5. Verify the invoice thread is deleted

Do we agree 👍 or 👎

@bernhardoj
Copy link
Contributor

Requested in ND.

@garrettmknight
Copy link
Contributor

$250 approved for @mollfpr

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

6 participants