Skip to content

Spend - Held expense is grouped by violation despite not being submitted yet. #107598

Open

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.5.49-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: #107141
Email or phone of affected tester (no customers): ibellicotest+3215@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Motorola MotoG60 / Android 12 (Hybrid app) - Windows 11 / Chrome
App Component: Search

Action Performed:

Prerequisite: User is owner of a "Control" workspace with "Rules" enabled.
Prerequisite 2: Have two unsubmitted expenses with violations available on the same report. (One held expense and one expense over amount limit)
Prerequisite 3: Submissions and approvals enabled.

  1. Open the staging.new.expensify.com website.
  2. Navigate to "Spend" > "Expenses"
  3. Click on "Display" > "Group By" > "Violations"
  4. Note that no results are displayed as expenses with violations are not submitted yet.
  5. Reset the filters.
  6. Navigate to workspace chat.
  7. Click on "Submit" on report preview > "Submit anyway"
  8. Note that expense over amount limit is submitted and held expense remains unsubmitted in a different report.
  9. Return to "Spend" > "Expenses"
  10. Click on "Display" > "Group By" > "Violations"
  11. Note that held expense is now grouped by violation despite not being submitted yet.

Expected Result:

Only submitted or approved expenses with violations should be visible after using the group-by violation filter.

Actual Result:

Held expense is grouped by violation despite not being submitted yet.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7320023_1795181569698.Vi.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Julia Ponikarchuk
Bug ID: 7320023

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Nov 20, 2026
  2. applause-bot commented on Nov 20, 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/cea4791bb61178e1250dad2770766fb1eb918eebdfa2a7a22ba745fcf0866a71

  3. expensify-chore-bot commented on Nov 20, 2026

    @expensify-chore-bot

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

  4. expensify-chore-bot commented on Nov 20, 2026

    @expensify-chore-bot

    @neil-marcellini you have been assigned to this deploy blocker because you reviewed the offending PR: #107141

  5. expensify-chore-bot commented on Nov 20, 2026

    @expensify-chore-bot

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

  6. expensify-chore-bot commented on Nov 20, 2026

    @expensify-chore-bot

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

  7. github-actions commented on Nov 20, 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.
  8. neil-marcellini commented on Nov 20, 2026

    @neil-marcellini
    Contributor

    (Neil's AI agent)

    I don't think this should block the deploy. It's a real bug, but it's in Auth, not in #107141. That PR only adds the grouping UI on top of the snapshot data the has:submitted-violation filter already reads, and that filter is already in production. It should return the same held expense today. I recommend removing DeployBlockerCash and fixing this in Auth.

    Problem

    When a report is submitted with a held expense, the submit snapshot still records the held expense's violations, even though that expense never gets submitted:

    1. SubmitReport calculates violations for the whole report, held expense included.
    2. It then moves the held expense to a new open report.
    3. It passes the earlier violations into Report::submit, which writes all of them onto the SUBMITTED action, held expense included.
    4. Search counts any expense listed in a submit snapshot, even after it has left that report, so the held expense shows up in its violation group (e.g. hold).

    The snapshot is taken before the move on purpose (commit), so it records what the person saw when they acted. The bug is that expenses moved off the report at that moment are treated as submitted.

    Solution

    In SubmitReport and Report::approve, keep calculating violations before the move, but pass the IDs of the expenses still on the report as the transactionIDFilter that applySnapshotToActionMessage already accepts. Held, pending and RTER expenses that were moved off then stay out of the snapshot. The existing test that expects RTER expenses that were moved off to be in the snapshot would need to flip. Snapshots that already include these expenses stay as they are unless we backfill them.

  9. MelvinBot commented on Nov 20, 2026

    @MelvinBot
    Contributor

    🤖 Web test steps verification results: ⚠️ partial

    Verification was blocked during fixture setup on dev NewDot web. A Control workspace was created, but the required held and over-limit expenses could not be established.
    Control workspace overview at the setup blocker

    Step Status
    Required workspace and expense fixtureConfirmed Control plan, but Rules and submissions/approvals navigation was not exposed in the inspected screen. Fixture setup stopped; this is a testing blocker, not confirmation of the reported regression.
    Control workspace overview at the setup blocker
    ❌
    Violations grouping before and after Submit anywayNot verified at runtime: the prerequisite expenses were unavailable. No Search request/response evidence was captured.

    Investigation finding: The deploy-blocker investigator identified Add group-by:violation as the feature-enabling PR, but could not establish that it introduced the underlying defect. Selecting Violation grouping adds submitted/approved violation filters; group rendering consumes returned search data. The PR does not change held-expense splitting.

    Hypothesis—not confirmed: Partial submission may incorrectly record or associate historical submitted violations with the held transaction. Incorrect server aggregation or stale client results remain alternatives. Backend implementation could not be inspected.

    Recommendation: Keep DeployBlockerCash pending verification. Capture fresh grouped and ungrouped Search responses using has:submitted-violation after submitting a report containing a never-submitted held expense. Inclusion in both responses points toward snapshot/filter handling; inclusion only in grouped results points toward aggregation; inclusion only before refresh points toward client state. If backend responsibility is confirmed, escalate to an internal engineer rather than applying an App-only status filter.

    Related evidence: The separate submitted-violation investigation identifies older backend snapshot-timing behavior, but does not prove this issue has the same cause. Reverting the feature would be containment, not a verified root-cause fix.
    ❌

    view run · view recording

  10. added and removed
    DeployBlockerCashThis issue or pull request should block deployment
    on Nov 20, 2026
  11. neil-marcellini commented on Nov 20, 2026

    @neil-marcellini
    Contributor

    I'll have AI work on a fix

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.DailyKSv2EngineeringReviewingHas a PR in review

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions