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-06-20][$250] Send invoice - Inconsistency in merchant requirement during and after invoice creation #41285

Closed
6 tasks done
m-natarajan opened this issue Apr 30, 2024 · 42 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

@m-natarajan
Copy link

m-natarajan commented Apr 30, 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: 1.4.68-0
Reproducible in staging?: Yes
Reproducible in production?: No (New feature)
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause Internal Team
Slack conversation:

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to FAB > Send invoice.
  3. Enter amount and select a participant.
  4. Create the invoice without merchant.
  5. Click on the invoice preview in the workspace chat.
  6. Click Merchant.
  7. Save it without entering a merchant.

Expected Result:

There should be consistency whether Merchant is required in confirmation page and invoice details page.

Actual Result:

In confirmation page (Step 4), invoice can be created without Merchant.
In invoice details page (Step 7), error shows up when saving empty merchant.

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

Bug6466110_1714440675796.bandicam_2024-04-30_09-27-19-715.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/~019d9923b61ac021d5
  • Upwork Job ID: 1785194578665390080
  • Last Price Increase: 2024-05-21
  • Automatic offers:
    • GandalfGwaihir | Contributor | 102525791
Issue OwnerCurrent Issue Owner: @miljakljajic
@m-natarajan m-natarajan added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 30, 2024
Copy link

melvin-bot bot commented Apr 30, 2024

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

Copy link

melvin-bot bot commented Apr 30, 2024

Triggered auto assignment to @miljakljajic (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 Apr 30, 2024
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.

@m-natarajan
Copy link
Author

We think this bug might be related to #wave-collect - Release 1

@m-natarajan
Copy link
Author

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

@robertjchen
Copy link
Contributor

Does not appear to be a serious deploy blocker to me and can be addressable by external contributors 👍

@robertjchen robertjchen added Daily KSv2 External Added to denote the issue can be worked on by a contributor and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 Daily KSv2 labels Apr 30, 2024
Copy link

melvin-bot bot commented Apr 30, 2024

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

@melvin-bot melvin-bot bot changed the title Send invoice - Inconsistency in merchant requirement during and after invoice creation [$250] Send invoice - Inconsistency in merchant requirement during and after invoice creation Apr 30, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 30, 2024
Copy link

melvin-bot bot commented Apr 30, 2024

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

@melvin-bot melvin-bot bot added the Daily KSv2 label Apr 30, 2024
@allgandalf
Copy link
Contributor

allgandalf commented Apr 30, 2024

Proposal

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

There is inconsistency for merchant requirement in invoice creation

What is the root cause of that problem?

We do not check if the current request is of invoice type and the isMerchantRequried is set to false:

const isMerchantRequired = isPolicyExpenseChat && !isScanRequest && shouldShowMerchant;

Whereas when we edit the invoice we have the following check in place:

const isMerchantRequired = ReportUtils.isGroupPolicy(report) || transaction?.participants?.some((participant) => Boolean(participant.isPolicyExpenseChat));

ReportUtils.isGroupPolicy(report) is set to true when editing a invoice merchant because at that time we are accessing the invoice as a workspace report, but during the creation of the transaction, ReportUtils.isGroupPolicy(report) is set to false and hence we do not get the required error on creation page of merchant

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

Add a check: isTypeInvoice as a || condition for isMerchantRequired:

const isTypeInvoice = iouType === CONST.IOU.TYPE.INVOICE;

We also need to update the Merchant page to mark merchant as required by putting a || condition for isTypeInvoice

const isMerchantRequired = ReportUtils.isGroupPolicy(report) || transaction?.participants?.some((participant) => Boolean(participant.isPolicyExpenseChat));

For merchants page, we can even check isInvoiceReport instead :

App/src/libs/ReportUtils.ts

Lines 682 to 684 in d299b32

function isInvoiceReport(report: OnyxEntry<Report> | EmptyObject): boolean {
return report?.type === CONST.REPORT.TYPE.INVOICE;
}

Note: I have considered that we require merchant, if we don't then we need to get away with the condition in IOURequestMerchant ie. we should update the isMerchantRequired to set to false if the report type is invoice.

@allgandalf
Copy link
Contributor

@robertjchen , what's the expected result here, we want the merchant to be set to required or is it not required ?

@allgandalf
Copy link
Contributor

I think it should be set to required as we send invoices as part of a workspace, and for any IOU in a workspace a merchant is required:
Screenshot 2024-04-30 at 12 32 16 PM

@allgandalf
Copy link
Contributor

Updated Proposal

Updated proposal to include more details

@melvin-bot melvin-bot bot changed the title [$250] Send invoice - Inconsistency in merchant requirement during and after invoice creation [HOLD for payment 2024-06-18] [$250] Send invoice - Inconsistency in merchant requirement during and after invoice creation Jun 11, 2024
Copy link

melvin-bot bot commented Jun 11, 2024

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jun 11, 2024
Copy link

melvin-bot bot commented Jun 11, 2024

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

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

  • @mollfpr requires payment through NewDot Manual Requests
  • @allgandalf requires payment (Needs manual offer from BZ)

Copy link

melvin-bot bot commented Jun 11, 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:

  • [@mollfpr / @allgandalf] The PR that introduced the bug has been identified. Link to the PR:
  • [@mollfpr / @allgandalf] 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:
  • [@mollfpr / @allgandalf] 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:
  • [@mollfpr / @allgandalf] Determine if we should create a regression test for this bug.
  • [@mollfpr / @allgandalf] 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.
  • [@miljakljajic] 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 Jun 13, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-06-18] [$250] Send invoice - Inconsistency in merchant requirement during and after invoice creation [HOLD for payment 2024-06-20] [HOLD for payment 2024-06-18] [$250] Send invoice - Inconsistency in merchant requirement during and after invoice creation Jun 13, 2024
Copy link

melvin-bot bot commented Jun 13, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.82-4 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-06-20. 🎊

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

  • @mollfpr requires payment through NewDot Manual Requests
  • @allgandalf requires payment (Needs manual offer from BZ)

Copy link

melvin-bot bot commented Jun 13, 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:

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

@robertjchen robertjchen changed the title [HOLD for payment 2024-06-20] [HOLD for payment 2024-06-18] [$250] Send invoice - Inconsistency in merchant requirement during and after invoice creation [HOLD for payment 2024-06-20][$250] Send invoice - Inconsistency in merchant requirement during and after invoice creation Jun 14, 2024
@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jun 18, 2024
Copy link

melvin-bot bot commented Jun 20, 2024

Payment Summary

Upwork Job

BugZero Checklist (@miljakljajic)

  • 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/1785194578665390080/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 Jun 20, 2024
@robertjchen
Copy link
Contributor

remaining steps above ^

@miljakljajic
Copy link
Contributor

@mollfpr is owed 250 USD for their work on this issue.

@allgandalf has been paid via upwork

@mollfpr
Copy link
Contributor

mollfpr commented Jun 22, 2024

[@mollfpr / @allgandalf] The PR that introduced the bug has been identified. Link to the PR:
[@mollfpr / @allgandalf] 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:

No offending PR.

[@mollfpr / @allgandalf] 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:
[@mollfpr / @allgandalf] Determine if we should create a regression test for this bug.

The regression step should be enough.

[@mollfpr / @allgandalf] 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.

  1. Go to FAB > Send invoice.
  2. Enter the amount and select a participant.
  3. Click on send invoice button
  4. Verify that you get an error immediately when trying to save without entering the merchant
  5. Click on the merchant
  6. Try saving merchant without entering any value
  7. Verify that you get an error when trying to save an empty merchant name
  8. 👍 or 👎

@JmillsExpensify
Copy link

$250 approved for @mollfpr. Also, re-opening for the regression test.

@miljakljajic
Copy link
Contributor

created an issue for the regression test

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

8 participants