Skip to content

[HOLD - E/App #70507] [$250] Scan - The error reappears on the WS chat on the LHN after submitting a scan request #70464

Closed

Description

@jponikarchuk

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: v9.2.13-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: https://test-management.browserstack.com/projects/2219752/test-runs/TR-780/folder/13176933/41237710/891996304?sort=%2Bidentifier
Email or phone of affected tester (no customers): n/a
Issue reported by: Applause Internal Team
Device used: Mac 15.4.1 Safari, Desktop, iPhone 13 iOS 18.6 Safari, HYbrid
App Component: Left Hand Navigation (LHN)

Action Performed:

  1. Navigate to https://staging.new.expensify.com
  2. Open the workspace chat
  3. Select Submit expense > Scan
  4. Upload a receipt that will fail
  5. Wait until it smartscans
  6. Edit the missing fields Amount and Merchant
  7. Verify the errors are cleared
  8. Submit the expense

Expected Result:

The error doesn't appear on the WS chat on LHN after submitting a scan request

Actual Result:

After editing the failed fields, all errors are cleared, but after submitting the expense, the error reappears ipn the WS chat on LHN.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021967441467761781932
  • Upwork Job ID: 1967441467761781932
  • Last Price Increase: 2025-09-15
Issue OwnerCurrent Issue Owner: @roryabraham

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Sep 12, 2025
  2. melvin-bot commented on Sep 12, 2025

    @melvin-bot

    Triggered auto assignment to @alexpensify (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. bernhardoj commented on Sep 13, 2025

    @bernhardoj
    Contributor

    Proposal

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

    The RBR shows again after submitting manually entered expense.

    What is the root cause of that problem?

    When we edit the amount, the BE already sends a receiptNotSmartScanned violation. However, the violation message (Receipt and expense details added manually.) is only shown if the user is not the submitter.

    if (violationName === CONST.VIOLATIONS.RECEIPT_NOT_SMART_SCANNED) {
    return isPolicyMember && !isSubmitter && !isReportOpen;
    }

    That's why we can't see it, but the RBR still show because it doesn't check whether the violation is shown or not.

    App/src/libs/ReportUtils.ts

    Lines 8210 to 8220 in 3938e13

    return potentialReports.some((potentialReport) => {
    if (!potentialReport) {
    return false;
    }
    return (
    !isInvoiceReport(potentialReport) &&
    (hasViolations(potentialReport.reportID, transactionViolations, true) ||
    hasWarningTypeViolations(potentialReport.reportID, transactionViolations, true) ||
    hasNoticeTypeViolations(potentialReport.reportID, transactionViolations, true))
    );

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

    We need to check for shouldShowViolation in hasNoticeTypeViolation (and other violation type).

    function hasNoticeTypeViolation(
    transaction: OnyxEntry<Transaction>,
    transactionViolations: TransactionViolation[] | OnyxCollection<TransactionViolation[]>,
    showInReview?: boolean,
    ): boolean {
    if (!doesTransactionSupportViolations(transaction)) {
    return false;
    }
    const violations = Array.isArray(transactionViolations) ? transactionViolations : transactionViolations?.[`${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${transaction?.transactionID}`];
    return !!violations?.some(
    (violation: TransactionViolation) =>
    violation.type === CONST.VIOLATION_TYPES.NOTICE &&
    (showInReview === undefined || showInReview === (violation.showInReview ?? false)) &&
    !isViolationDismissed(transaction, violation),
    );
    }

    !isViolationDismissed(transaction, violation) && shouldShowViolation(report, policy, violation.name, true),
    

    report and policy will be a new param.

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

    We can test hasNoticeTypeViolation (and others) to make sure it returns false when shouldShowViolation is false even though the violation exist.

  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Sep 15, 2025
  5. melvin-bot commented on Sep 15, 2025

    @melvin-bot
  6. changed the title [-]Scan - The error reappears on the WS chat on the LHN after submitting a scan request[/-] [+][$250] Scan - The error reappears on the WS chat on the LHN after submitting a scan request[/+] on Sep 15, 2025
  7. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Sep 15, 2025
  8. melvin-bot commented on Sep 15, 2025

    @melvin-bot

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

  9. alexpensify commented on Sep 15, 2025

    @alexpensify
    Contributor

    @jayeshmangwani - When you get a chance, please review if this proposal will fix the issue? Thanks!

  10. jayeshmangwani commented on Sep 15, 2025

    @jayeshmangwani
    Contributor

    @bernhardoj 's proposal #70464 (comment) works well for hiding the resolved violations, let’s go with the fix.

    🎀 👀 🎀 C+ reviewed

  11. 4 remaining items

  12. changed the title [-][$250] Scan - The error reappears on the WS chat on the LHN after submitting a scan request[/-] [+][HOLD - E/App #70507] [$250] Scan - The error reappears on the WS chat on the LHN after submitting a scan request[/+] on Sep 17, 2025
  13. roryabraham commented on Sep 26, 2025

    @roryabraham
    Contributor

    Still on HOLD

  14. roryabraham commented on Oct 2, 2025

    @roryabraham
    Contributor

    Still on HOLD

  15. alexpensify commented on Oct 7, 2025

    @alexpensify
    Contributor

    Weekly Update: On Hold

  16. roryabraham commented on Oct 14, 2025

    @roryabraham
    Contributor
  17. m-natarajan commented on Oct 15, 2025

    @m-natarajan

    The issue is no longer reproducible on Windows 11, Chrome and mWeb, Chrome, Build: v9.2.31-0

    az_recorder_20251014_211949.mp4
    explorer_lVnkgbZnEY.mp4
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.ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributorsWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions