Skip to content

[Awaiting Payment 2025-12-02][$250] RBR badge persists on expense chat after submission (should not appear for non-draft reports) #73154

Closed

Description

@m-natarajan

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.2.35-4
Reproducible in staging?: Y
Reproducible in production?: Y
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: @trjExpensify
Slack conversation (hyperlinked to channel name): #Quality

Action Performed:

  1. Create a report and add an expense that triggers an RBR violation (e.g. alcohol category with violation rule)
  2. Submit the report
  3. Check the Left Hand Navigation (LHN) and expense chat for that report
  4. Observe the RBR red dot still showing next to the expense chat

Expected Result:

RBR indicators should not display for submitted (non-draft) reports.
Once a report is no longer editable by the user, RBR should be cleared from the LHN and chat list for that user.

Actual Result:

The RBR badge remains visible on the expense chat even though the report has already been submitted.

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
Image

The onyx state 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/~021981442084194388330
  • Upwork Job ID: 1981442084194388330
  • Last Price Increase: 2025-10-23
Issue OwnerCurrent Issue Owner: @VictoriaExpensify

Activity

  1. added
    Daily
    Bug
    on Oct 21, 2025
  2. melvin-bot commented on Oct 21, 2025

    @melvin-bot

    Triggered auto assignment to @stephanieelliott (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. paulnjs commented on Oct 21, 2025

    @paulnjs
    Contributor

    Proposal

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

    RBR badge persists on expense chat after submission (should not appear for non-draft reports)

    What is the root cause of that problem?

    In the function

    function shouldDisplayViolationsRBRInLHN(report: OnyxEntry<Report>, transactionViolations: OnyxCollection<TransactionViolation[]>): boolean {
    , we don’t check whether the report is in draft status before evaluating violations:

    App/src/libs/ReportUtils.ts

    Lines 8532 to 8538 in 17b617e

    return (
    !isInvoiceReport(potentialReport) &&
    ViolationsUtils.hasVisibleViolationsForUser(potentialReport, transactionViolations, policy, transactions) &&
    (hasViolations(potentialReport.reportID, transactionViolations, true) ||
    hasWarningTypeViolations(potentialReport.reportID, transactionViolations, true) ||
    hasNoticeTypeViolations(potentialReport.reportID, transactionViolations, true))
    );

    However, the expected behavior is that RBR indicators should not display for submitted (non-draft) reports.

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

    We should add an early return at this line:


    to prevent evaluating violations for non-draft reports. For example:

    
    if (!isOpenReport(potentialReport)) {
        return false;
    }
    
    • We can also set the value to false if it non-draft reports:
      const doesReportHasViolations = hasReportViolations(report?.reportID);

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

    What alternative solutions did you explore? (Optional)

  4. dmkt9 commented on Oct 22, 2025

    @dmkt9
    Contributor

    Proposal

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

    The RBR badge remains visible on the expense chat even though the report has already been submitted.

    What is the root cause of that problem?

    Currently, when submitting, the submitReport function does not clear the TRANSACTION_VIOLATIONS for the transactions within the report.

    function submitReport(

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

    We need to clear the TRANSACTION_VIOLATIONS of the transactions in the report by updating the optimisticData, successData, and failureData.

    const optimisticData: OnyxUpdate[] = [

    As a result, we also need to adjust related logic accordingly, such as in buildNextStepNew.

    Additionally, we must ensure that the backend returns the correct TRANSACTION_VIOLATIONS data when the API call succeeds.

    What alternative solutions did you explore? (Optional)

    NA

  5. added
    External
    on Oct 23, 2025
  6. melvin-bot commented on Oct 23, 2025

    @melvin-bot
  7. changed the title [-]RBR badge persists on expense chat after submission (should not appear for non-draft reports)[/-] [+][$250] RBR badge persists on expense chat after submission (should not appear for non-draft reports)[/+] on Oct 23, 2025
  8. added
    Help Wanted
    on Oct 23, 2025
  9. melvin-bot commented on Oct 23, 2025

    @melvin-bot

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

  10. melvin-bot commented on Oct 28, 2025

    @melvin-bot

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

  11. 48 remaining items

  12. rlinoz commented on Dec 8, 2025

    @rlinoz
    Contributor

    Hey @VictoriaExpensify the PR is deployed to production #75231 (comment)

    This is just needs the checklist and payment.

  13. VictoriaExpensify commented on Dec 8, 2025

    @VictoriaExpensify
    Contributor

    Thanks for clearing that up @rlinoz !

  14. VictoriaExpensify commented on Dec 8, 2025

    @VictoriaExpensify
    Contributor

    BugZero Checklist:

    • [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to comment: no regression

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion: N/A

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:

    Regression Test Proposal

  15. VictoriaExpensify commented on Dec 8, 2025

    @VictoriaExpensify
    Contributor

    Payment Summary:
    C: @paulnjs - please accept UW offer and I will process payment
    C+: @thesahindia please complete the checklist and I'll organise payment

    Thanks!

  16. added
    Daily
    and removed
    Daily
    on Dec 11, 2025
  17. thesahindia commented on Dec 12, 2025

    @thesahindia
    Member

    We just need to add test steps for this. The steps are below:

    Pre condition:

    • Have a workspace
    • Prohibited expense are enabled (e.g. alcohol, gambling)
    1. Go to workspace chat
    2. Create expense > Scan > Add receipt for prohibited expense
    3. Verify RBR indicator appears in LHN for the report
    4. Submit the expense
    5. Verify the RBR indicator disappears
  18. VictoriaExpensify commented on Dec 14, 2025

    @VictoriaExpensify
    Contributor

    Raised request to add reg. test to browserstack - https://github.com/Expensify/Expensify/issues/578467

  19. VictoriaExpensify commented on Dec 14, 2025

    @VictoriaExpensify
    Contributor

    Updated payment summary:

    Payment Summary:
    C: @paulnjs paid $250 via Upwork
    C+: @thesahindia owed $250 via NewDot

    Thanks!

  20. garrettmknight commented on May 21, 2026

    @garrettmknight
    Contributor

    $250 approved for @thesahindia

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternalMonthly

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions