Skip to content

Expense report- Violation expense follows the expense without violation #96371

Closed

Description

@applause-bot

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.4.36-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #96022
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Bug source: Pull Request QA execution
Device used: Pixel 7a/ Android 16
App Component: Chat Report View

Action Performed:

Preconditions:

  • Create new account, create a workspace
  1. Open Hybrid app / https://staging.new.expensify.com/
  2. Go to workspace chat
  3. Create an expense with violation (date: today, leave the category empty)
  4. Create 2 more expense without violation (date is older than today)
  5. Open the report

Expected Result:

Step 4 in PR :Verify that the expense with a violation is and then followed by an expense without a violation

Actual Result:

Expense with a violation follow the expenses without violation in report page.
If create an expense with a violation when enable rules (ex: amount over $25 without receipt), the violation expense is displayed first

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7210414_1784258089130.96022I.mp4
Bug7210414_1784258089125.96022A.mp4
Image

View all open jobs on GitHub

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

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jul 17, 2026
  2. MelvinBot commented on Jul 17, 2026

    @MelvinBot
    Contributor

    Issue Analysis

    This looks like a duplicate of #90063 ("Expense without category appears in the first place in carousel, then moves to last place"), which already has an approved root-cause analysis and an open fix in review (#90464). The two reports describe the same bug at different moments: #90063 captures the transition (violation expense flashes to the top, then drops), and this issue captures the settled end state (violation expense sits below the non-violation ones).

    Root Cause: The report/carousel sort pushes transactions with a red-brick-road (RBR) indicator to the top, and RBR is detected via transactionHasRBR → hasViolation(..., showInReview=true). That check only counts a violation when showInReview === true (TransactionUtils/index.ts:2135).

    • On creation, the client writes an optimistic missingCategory violation with showInReview: true (ViolationsUtils.ts:553-554), so the empty-category expense briefly sorts first.
    • When the server response syncs, its missingCategory violation comes back with showInReview false/omitted, so hasViolation(..., true) now returns false. RBR disappears and the expense falls back to its natural date order — and since it has today's date (newest) while the others are older, it lands last.

    This is exactly why the rules-based case behaves differently: a receiptRequired-type violation is returned by the server with showInReview: true, so it keeps its RBR and stays on top. The sort itself is violation-type-agnostic — the divergence is entirely in the synced showInReview flag.

    Investigation details

    Scope note: The in-review fix (#90464) only touches the carousel preview (MoneyRequestReportPreviewContent.tsx). This report is about the report page transaction list, which sorts through the same transactionHasRBR/showInReview path. Whoever picks this up should confirm the report-page ordering is covered too, not just the carousel — and decide whether the durable fix belongs on the client (don't require showInReview for missingCategory RBR) or on the server (return missingCategory with showInReview: true, matching receiptRequired).

    Related issues (likely duplicate):


    Recommended next step: Close this as a duplicate of #90063 and track the fix there, while confirming the report-page path is included in the fix scope.

    Reply with @MelvinBot <your feedback> to refine this analysis.

  3. melvin-bot commented on Jul 17, 2026

    @melvin-bot

    📣 @zeryns! 📣
    Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
    Please follow these steps:

    1. Make sure you've read and understood the contributing guidelines.
    2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
    3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
    4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
      Screen Shot 2022-11-16 at 4 42 54 PM
      Format:
    Contributor details
    Your Expensify account email: <REPLACE EMAIL HERE>
    Upwork Profile Link: <REPLACE LINK HERE>
    
  4. melvin-bot commented on Jul 17, 2026

    @melvin-bot

    ✅ Contributor details stored successfully. Thank you for contributing to Expensify!

  5. melvin-bot commented on Jul 20, 2026

    @melvin-bot

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

  6. melvin-bot commented on Jul 22, 2026

    @melvin-bot

    Huh... This is 4 days overdue. Who can take care of this?

  7. melvin-bot commented on Jul 24, 2026

    @melvin-bot

    Still overdue 6 days?! Let's take care of this!

  8. melvin-bot commented on Jul 28, 2026

    @melvin-bot

    10 days overdue. I'm getting more depressed than Marvin.

  9. melvin-bot commented on Jul 30, 2026

    @melvin-bot

    12 days overdue. Walking. Toward. The. Light...

  10. melvin-bot commented on Jul 31, 2026

    @melvin-bot

    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!

  11. melvin-bot commented on Aug 3, 2026

    @melvin-bot

    This issue has not been updated in over 14 days. eroding to Weekly issue.

  12. melvin-bot commented on Aug 27, 2026

    @melvin-bot

    This issue has not been updated in over 15 days. 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!

  13. melvin-bot commented on Nov 9, 2026

    @melvin-bot

    @applause-bot[bot], this Monthly task hasn't been acted upon in 6 weeks; closing.

    If you disagree, feel encouraged to reopen it -- but pick your least important issue to close instead.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething is broken. Auto assigns a BugZero manager.MonthlyKSv2Not a priority

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions