Skip to content

Expense - "Expense exceeds auto-approval limit" violation does not appear on expense preview #99613

Closed

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: 9.4.62-1
Reproducible in staging?: Yes
Reproducible in production?: N/A - new feature, doesn't exist in prod
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #99016
Email or phone of affected tester (no customers): sdsiodjnosdjiodsj@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.5 / Chrome
App Component: Money Requests

Action Performed:

Precondition:

  • Enable Auto-approve compliant reports in Workflows settings.
  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Create an expense with amount more than 100.00.
  4. Click Submit on the expense preview.
  5. Open the expense.
  6. Close the expense.

Expected Result:

"Expense exceeds auto-approval limit" violation will appear on expense preview (it is shown on Spend > Expenses and similar to Missing category violation).

Actual Result:

"Expense exceeds auto-approval limit" violation does not appear on expense preview.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7243713_1787782769278.5.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Mita Rachim
Bug ID: 7243713

Issue OwnerCurrent Issue Owner: @linhvovan29546

Activity

  1. added
    DeployBlockerCash
    Bug
    on Aug 26, 2026
  2. applause-bot commented on Aug 26, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/bb465fc6120640e29b10105389278c76d5109e412064e5eb88e1afa6e0f89f6a

  3. melvin-bot commented on Aug 26, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #99016

  4. melvin-bot commented on Aug 26, 2026

    @melvin-bot

    @arosiclair @linhvovan29546 you have been assigned to this deploy blocker because you reviewed the offending PR: #99016

  5. github-actions commented on Aug 26, 2026

    @github-actions
    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.
  6. melvin-bot commented on Aug 26, 2026

    @melvin-bot

    @KioCoan you have been assigned to this deploy blocker because you authored the offending PR: #99016

  7. melvin-bot commented on Aug 26, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  8. MelvinBot commented on Aug 26, 2026

    @MelvinBot
    Contributor

    Deploy Blocker Analysis

    Causing PR: Expensify/App#99016 — "Show the auto-approval limit notice when the submitter is also the approver" (High confidence). This is a frontend bug in App.

    Root cause: #99016 correctly unblocked the overAutoApprovalLimit notice for a submitter-who-is-also-approver and wired it into the expense detail and Search / Spend > Expenses, but it never touched the expense preview render path. The preview only renders a violation message when shouldShowRBR is true, and for a notice-type violation that flag is driven by hasNoticeTypeViolation(..., showInReview = true). The overAutoApprovalLimit notice arrives with showInReview falsy, so it's dropped from the preview's RBR calculation — while the detail view (which groups all visible violations onto the amount row, no showInReview filter) still shows it. That split is exactly the reported symptom.

    The reporter's comparison to "Missing category" is misleading: missingCategory is a hard VIOLATION with showInReview: true, so it always lights up the preview RBR; overAutoApprovalLimit is a NOTICE that the preview treats differently.

    Recommendation: roll forward with a targeted fix — do NOT revert. Reverting reintroduces Expensify/App#94999 (submitter-approver held for manual approval with no on-screen explanation anywhere), which is worse. Backend enforcement is unaffected (the report is correctly held), and the notice already shows on the expense detail and in Search — only the preview card is missing it, affecting a narrow role (admins who submit to themselves). Good DEMOTE candidate if a same-checklist patch isn't feasible.

    Suggested targeted fix + evidence

    The violations array passed to createTransactionPreviewConditionals is already pre-filtered through shouldShowViolation (via useTransactionViolations), so the notice's mere presence means "this user should see it." Add it to hasAnyViolations in src/libs/TransactionPreviewUtils.ts:406-436, mirroring the existing distance MODIFIED_AMOUNT special-case just below, so it bypasses the showInReview notice gate:

    const hasAnyViolations =
        !!hasViolationsOfTypeNotice ||
        hasWarningTypeViolation(...) ||
        hasViolation(...) ||
        // Auto-approval-limit notice is pre-filtered by shouldShowViolation; its presence means it should surface on the preview.
        violations?.some((violation) => violation.name === CONST.VIOLATIONS.OVER_AUTO_APPROVAL_LIMIT) ||
        (isDistanceRequest(transaction) && violations?.some((violation) => violation.name === CONST.VIOLATIONS.MODIFIED_AMOUNT && ...));

    This doesn't affect other roles (the notice only reaches this array when shouldShowViolation already returned true) and works regardless of the backend showInReview value. Alternatively, delivering the notice with showInReview: true from the backend would light up the existing hasViolationsOfTypeNotice path — but that changes behavior across all consumers, so KioCoan should confirm which surface is the intended source of truth.

    Key references:

    Confidence: causing PR High; exact mechanism Medium-High (the backend showInReview value couldn't be inspected here, but the "detail shows / preview hides" split is precisely and only explained by it).

    Assignees (KioCoan as author, linhvovan29546 and arosiclair as reviewers) are already correct, and DeployBlockerCash should stay until the fix lands.


    view run

  9. 7 remaining items

  10. added
    Reviewing
    Weekly
    and removed
    Daily
    on Aug 31, 2026
  11. added
    Daily
    and removed
    Reviewing
    Weekly
    on Sep 9, 2026
  12. melvin-bot commented on Sep 9, 2026

    @melvin-bot

    @linhvovan29546

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.74-2 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]

  13. melvin-bot commented on Sep 9, 2026

    @melvin-bot

    @arosiclair @KioCoan @linhvovan29546 this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

  14. linhvovan29546 commented on Sep 10, 2026

    @linhvovan29546
    Contributor

    No Checklist Needed

    This is a follow-up to #94999, and I’ve already updated the regression test to include this case. We can close this issue, and no payment is needed.

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

Metadata

Metadata

Labels

BugDailySkip Payment

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions