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-09-26][$250] Violations - "Receipt required" error message is missing from the expense details #47105

Closed
1 of 6 tasks
lanitochka17 opened this issue Aug 8, 2024 · 34 comments
Assignees
Labels
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

@lanitochka17
Copy link

lanitochka17 commented Aug 8, 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.18-3
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team

Issue was found when executing PR #44995 (comment)

Action Performed:

  1. ND: Navigate to https://staging.new.expensify.com/
  2. ND: Log in and validate a new Gmail account
  3. ND: Create a workspace
  4. ND: Switch to OD by navigating to Account settings - Cards & Domains
  5. OD: Navigate to Settings - Workspaces - Group - Created workspace - Expenses
  6. OD: Enable "Expense Violations"
  7. OD: Upgrade the workspace to Control by clicking on the padlock icon
  8. OD: Set "Receipt Required Amount" to any value but remain under the value set in "Max Expense Amount"
  9. ND: Navigate to the workspace chat
  10. ND: Navigate to Composers "+" button - Submit expense - Manual
  11. ND: Set any value that's above "Receipt Required Amount" set in OD but under "Max Expense Amount"

Expected Result:

"Receipt required" error message should be visible

Actual Result:

"Receipt required" error message is missing from the expense details. The RBR shows in the LHN but the message is missing. Affects "Receipt Required Amount" amount set in OD Expenses tab and "Max Amount" set in a Category too

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

Add any screenshot/video evidence

Bug6565908_1723140325765.bandicam_2024-08-08_19-50-44-957.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01da9c71405c9b9ab9
  • Upwork Job ID: 1823792599432282200
  • Last Price Increase: 2024-08-14
  • Automatic offers:
    • akinwale | Reviewer | 103539096
    • ShridharGoel | Contributor | 103539097
    • dominictb | Contributor | 103689285
Issue OwnerCurrent Issue Owner: @akinwale
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 8, 2024
Copy link

melvin-bot bot commented Aug 8, 2024

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

@dominictb
Copy link
Contributor

Proposal

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

"Receipt required" error message is missing from the expense details. The RBR shows in the LHN but the message is missing. Affects "Receipt Required Amount" amount set in OD Expenses tab and "Max Amount" set in a Category too

What is the root cause of that problem?

We do not handle the case the transaction have violation receiptRequired when displaying audit messages. In there:

const shouldShowAuditMessage = !isReceiptBeingScanned && hasReceipt && !!(receiptViolations.length || didReceiptScanSucceed) && ReportUtils.isPaidGroupPolicy(report);

we just display the audit if hasReceipt is true although we have violation receiptRequired.

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

Need to create new variable receiptRequiredViolation:

    const receiptRequiredViolation = transactionViolations?.find((violation) => violation.name === CONST.VIOLATIONS.RECEIPT_REQUIRED);

then update shouldShowAuditMessage:

    const shouldShowAuditMessage = !isReceiptBeingScanned && (hasReceipt || receiptRequiredViolation) && !!(receiptViolations.length || didReceiptScanSucceed) && ReportUtils.isPaidGroupPolicy(report);

What alternative solutions did you explore? (Optional)

If we don't want to display the audit result in case of receiptRequired violation, beside the main solution above, add an additional && !receiptRequiredViolation to:

shouldShowAuditResult={shouldShowAuditMessage}

@cead22
Copy link
Contributor

cead22 commented Aug 12, 2024

@ShridharGoel this case should've been covered in the tests for this PR #45760, right? If so, can you take this over and fix it please?

Copy link

melvin-bot bot commented Aug 12, 2024

@puneetlath Whoops! This issue is 2 days overdue. Let's get this updated quick!

Copy link

melvin-bot bot commented Aug 14, 2024

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

@puneetlath puneetlath added the External Added to denote the issue can be worked on by a contributor label Aug 14, 2024
@melvin-bot melvin-bot bot changed the title Violations - "Receipt required" error message is missing from the expense details [$250] Violations - "Receipt required" error message is missing from the expense details Aug 14, 2024
Copy link

melvin-bot bot commented Aug 14, 2024

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

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

melvin-bot bot commented Aug 14, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Aug 14, 2024
@ShridharGoel
Copy link
Contributor

@cead22 Sure, I'll be checking this.

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

melvin-bot bot commented Aug 15, 2024

📣 @akinwale 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Aug 15, 2024

📣 @ShridharGoel 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@dominictb
Copy link
Contributor

@puneetlath I don't think this issue is related to PR, because that PR is just to remove violations beta from front-end. Can you help check again?

@dominictb
Copy link
Contributor

@puneetlath Can you check my comment above? Thanks

@puneetlath
Copy link
Contributor

@akinwale @dominictb @ShridharGoel maybe y'all can figure that out between you?

Copy link

melvin-bot bot commented Aug 20, 2024

@puneetlath, @akinwale, @ShridharGoel Eep! 4 days overdue now. Issues have feelings too...

@dominictb
Copy link
Contributor

@akinwale Can you verify my comment?

@puneetlath
Copy link
Contributor

@akinwale any thoughts?

@puneetlath puneetlath assigned dominictb and unassigned ShridharGoel Aug 26, 2024
Copy link

melvin-bot bot commented Aug 26, 2024

📣 @dominictb 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@cead22
Copy link
Contributor

cead22 commented Aug 26, 2024

@puneetlath I don't think this issue is related to PR, because that PR is just to remove violations beta from front-end. Can you help check again?

@dominictb do the test steps in that PR not cover this scenario? If so, can you share how we need to update those test steps to make sure this case is covered?

If the tests do cover this scenario, then I think it makes sense to consider this as a regression of that PR, since the reason this issue #44995 was created with a higher bounty than the default, was to ensure the tests all passed.

That said, I don't feel super strongly about treating this as a regression vs considering it a new issue. I just wanted to provide the context and make sure that we update the test steps as part of the proposal

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Aug 28, 2024
@dominictb
Copy link
Contributor

do the test steps in that PR not cover this scenario?

Yes. It does not cover this scenario because this issue does not belong to scope of that PR.

If so, can you share how we need to update those test steps to make sure this case is covered.

The test steps are added in here.

@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Sep 20, 2024
Copy link

melvin-bot bot commented Sep 20, 2024

This issue has not been updated in over 15 days. @puneetlath, @akinwale, @dominictb eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@puneetlath
Copy link
Contributor

Looks like the PR was deployed to production 3 days ago. Is that right?

@akinwale
Copy link
Contributor

Looks like the PR was deployed to production 3 days ago. Is that right?

Yes, that seems to be the case which would make the payment due date 2024-09-26. The update must've been missed by automation.

@puneetlath puneetlath changed the title [$250] Violations - "Receipt required" error message is missing from the expense details [HOLD for payment 2024-09-26][$250] Violations - "Receipt required" error message is missing from the expense details Sep 23, 2024
@dominictb
Copy link
Contributor

@puneetlath Since this is awaiting payment. Can you remove the Monthly and Reviewing labels and add Daily?

@mallenexpensify mallenexpensify self-assigned this Oct 2, 2024
@mallenexpensify mallenexpensify added Daily KSv2 and removed Reviewing Has a PR in review Monthly KSv2 labels Oct 2, 2024
@mallenexpensify
Copy link
Contributor

Contributor: @dominictb paid $250 via Upwork
Contributor+: @akinwale paid $250 via Upwork

@akinwale plz complete the BZ checklist.

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:

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

@mallenexpensify
Copy link
Contributor

@akinwale plz complete the BZ checklist above

@melvin-bot melvin-bot bot added the Overdue label Oct 7, 2024
Copy link

melvin-bot bot commented Oct 8, 2024

@puneetlath, @akinwale, @mallenexpensify, @dominictb Huh... This is 4 days overdue. Who can take care of this?

@akinwale
Copy link
Contributor

akinwale commented Oct 10, 2024

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

Not a regression.

  • [@akinwale] Determine if we should create a regression test for this bug.
  • [@akinwale] 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 Steps
New Dot

  • Launch Expensify
  • Log in with a new Gmail account
  • Create a Workspace
  • Navigate to Old Dot by accessing Account settings > Cards & Domains

Old Dot

  • Navigate to Settings > Workspaces > Group > "Created workspace" > Expenses
  • Enable Expense Violations
  • Upgrade the Workspace to a Control workspace
  • Set "Receipt Required Amount" to any value under the value set in "Max Expense Amount"
  • Switch back to New Dot

New Dot

  • Navigate to the workspace chat
  • Submit a new manual expense with an amount that is more than "Receipt Required Amount" and less than "Max Expense Amount"
  • Verify that the Receipt Required error message is displayed for the expense.

Do we agree 👍 or 👎?

@melvin-bot melvin-bot bot removed the Overdue label Oct 10, 2024
@akinwale
Copy link
Contributor

@mallenexpensify Done!

@mallenexpensify
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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
Archived in project
Development

No branches or pull requests

7 participants