Skip to content

Expense report previews are missing violations RBR's when an expense in the report is auto-categorized #68549

Closed

Description

@m-natarajan

Note from the future: skip to this comment

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:
Reproducible in staging?: Needs Reproduction
Reproducible in production?: Needs reproduction
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @shawnborton
Slack conversation (hyperlinked to channel name): #Quality

Action Performed:

  1. Go to the workspace chat where a report was submitted
  2. View the expense report preview in the chat
  3. Click into the report, then go back to the workspace chat

Expected Result:

The report preview should always show the status, total amount, and correct report title without requiring the user to click into the report first.

Actual Result:

The preview does not display the report status
The preview does not display the total amount until after opening the report, the report title does not update even after clicking into the report (but the total does update)

Workaround:

Unknown

Platforms:

Select the officially supported platforms where the issue was reproduced:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop
Platforms Tested: On which of our officially supported platforms was this issue tested:
  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

The screenshot and logs for the issue is in OP

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021956364914676875554
  • Upwork Job ID: 1956364914676875554
  • Last Price Increase: 2025-08-15

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    retest-weeklyApply this label if you want this issue tested on a Weekly basis by Applause
    on Aug 14, 2025
  2. melvin-bot commented on Aug 14, 2025

    @melvin-bot

    Triggered auto assignment to @joekaufmanexpensify (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. MelvinBot commented on Aug 14, 2025

    @MelvinBot
    Contributor

    This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989

  4. joekaufmanexpensify commented on Aug 15, 2025

    @joekaufmanexpensify
    Contributor
  5. changed the title [-]Expense report preview is missing status, missing total, and report title not updating[/-] [+][$250] Expense report preview is missing status, missing total, and report title not updating[/+] on Aug 15, 2025
  6. melvin-bot commented on Aug 15, 2025

    @melvin-bot
  7. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Aug 15, 2025
  8. 21 remaining items

  9. chuckdries commented on Sep 5, 2025

    @chuckdries
  10. joekaufmanexpensify commented on Sep 8, 2025

    @joekaufmanexpensify
    Contributor

    TY!

  11. chuckdries commented on Sep 10, 2025

    @chuckdries
    Contributor

    So, this is actually two discrete issues

    1. Expense violations don't work properly with concierge auto-categorization
    2. Sometimes we don't send the IOUReport to the client when we should

    Going forward, this issue will be focused on solving number 1. Number 2 will be tracked by https://github.com/Expensify/Expensify/issues/545950

    Expense violations and auto-categorization

    Let's start with some concrete, reproducible bugs

    Bug: when concierge moves an expense with no description into a category that requires descriptions, no violation is created

    1. Enable the "Categories" feature on your workspace if it isn't already
    2. Enable "Require description" under "Category rules" for the "Meals and Entertainment" category on your policy
    3. Create an expense in the workspace, leave the description blank, but set the merchant to a well known restaurant
    4. Go to the workspace chat and wait for concierge to apply the "Meals and Entertainment" category.

    Expected: Expense shows "Review required" RBR under category
    Observed: no RBR until the user navigates to the report

    auto-categorization.violations.do.not.work.mp4

    Bug: when concierge moves an expense on a report with existing expenses that have violations, the existing violations are cleared

    1. Create a report and add an expense with any violation
    2. Go to the workspace chat
    3. Add a new expense without a category. It doesn't matter whether this expense has or will have violations or not

    Expected: Existing expenses keep their violations after auto-categorization runs
    Observed: Existing violations are cleared until the user navigates to the report

    auto-categorization.clears.existing.violations.mp4

    Root cause

    Both of these bugs have the same root cause: auto-categorization tries to calculate violations, but we call Violations::get with concierge's accountID, which won't be listed on the actual report or sharedReport records. This requires a backend fix

  12. changed the title [-][$250] Expense report preview is missing status, missing total, and report title not updating[/-] [+]Expense report previews are missing violations RBR's when an expense in the report is auto-categorized[/+] on Sep 10, 2025
  13. s77rt commented on Sep 15, 2025

    @s77rt
    Member

    This is same as #66825

  14. joekaufmanexpensify commented on Sep 15, 2025

    @joekaufmanexpensify
    Contributor

    Ah, interesting. Do you agree with that @chuckdries ?

  15. chuckdries commented on Sep 15, 2025

    @chuckdries
    Contributor

    Ah yeah looks like they do have the same root cause

  16. joekaufmanexpensify commented on Sep 15, 2025

    @joekaufmanexpensify
    Contributor

    Got it. Should we close this one in favor of that one then?

  17. chuckdries commented on Sep 15, 2025

    @chuckdries
    Contributor

    Would it be too weird to leave them both open but let them both be fixed by the same PR? They're distinct in terms of the user flows that need to be tested, they just have the same underlying cause

  18. joekaufmanexpensify commented on Sep 15, 2025

    @joekaufmanexpensify
    Contributor

    Nope, that's fine too. But we'll just go with @s77rt's PR to fix it?

  19. chuckdries commented on Sep 16, 2025

    @chuckdries
    Contributor

    Yep, looks like their PR did the trick. I'll close this issue out when the fix goes to prod.

  20. joekaufmanexpensify commented on Sep 17, 2025

    @joekaufmanexpensify
    Contributor

    great. TY!

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.InternalRequires API changes or must be handled by Expensify staffWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions