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

[$250] Violations - "Receipt required" error message is missing from the expense details #47105

Open
1 of 6 tasks
lanitochka17 opened this issue Aug 8, 2024 · 26 comments
Open
1 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Monthly KSv2 Reviewing Has a PR in review

Comments

@lanitochka17
Copy link

lanitochka17 commented Aug 8, 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.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

@melvin-bot melvin-bot bot added the Overdue label Aug 19, 2024
@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?

Copy link

melvin-bot bot commented Aug 22, 2024

@puneetlath @akinwale @ShridharGoel this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

Copy link

melvin-bot bot commented Aug 22, 2024

@puneetlath, @akinwale, @ShridharGoel 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

@puneetlath
Copy link
Contributor

@akinwale bump.

@akinwale
Copy link
Contributor

Missed the initial notification on this.

It looks like @dominictb's assessment is accurate. The proposed root cause and fix is not related to violations being in beta, so we can move forward with the proposal here.

🎀👀🎀 C+ reviewed.

@melvin-bot melvin-bot bot removed the Overdue label Aug 26, 2024
Copy link

melvin-bot bot commented Aug 26, 2024

Current assignee @puneetlath is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

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

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. External Added to denote the issue can be worked on by a contributor Monthly KSv2 Reviewing Has a PR in review
Projects
Status: No status
Development

No branches or pull requests

6 participants