Skip to content

[HOLD for payment 2024-09-26][$250] Violations - "Receipt required" error message is missing from the expense details #47105

Closed

Description

@lanitochka17

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

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Aug 8, 2024
  2. melvin-bot commented on Aug 8, 2024

    @melvin-bot

    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.

  3. dominictb commented on Aug 8, 2024

    @dominictb
    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}

  4. cead22 commented on Aug 12, 2024

    @cead22
    Contributor

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

  5. melvin-bot commented on Aug 12, 2024

    @melvin-bot

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

  6. melvin-bot commented on Aug 14, 2024

    @melvin-bot

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

  7. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Aug 14, 2024
  8. 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[/+] on Aug 14, 2024
  9. melvin-bot commented on Aug 14, 2024

    @melvin-bot
  10. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Aug 14, 2024
  11. melvin-bot commented on Aug 14, 2024

    @melvin-bot

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

  12. 34 remaining items

  13. dominictb commented on Oct 1, 2024

    @dominictb
    Contributor

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

  14. mallenexpensify commented on Oct 2, 2024

    @mallenexpensify
    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:
  15. mallenexpensify commented on Oct 7, 2024

    @mallenexpensify
    Contributor

    @akinwale plz complete the BZ checklist above

  16. melvin-bot commented on Oct 8, 2024

    @melvin-bot

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

  17. akinwale commented on Oct 10, 2024

    @akinwale
    Contributor
    • [@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 👎?

  18. akinwale commented on Oct 10, 2024

    @akinwale
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions