Skip to content

[Due for payment 2025-10-13] [$250] Expense - Paying the expense removed the amount violation, but it re-appeared later #67328

Closed

Description

@lanitochka17

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.1.87-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team

Action Performed:

  1. Launch app
  2. Create a Workspace
  3. Tap overview - change plan to control
  4. Go to workspace chat
  5. Create a manual expense with 8 digit number which shows violation for amount
  6. Submit, approve and pay elsewhere via top dropdown

Expected Result:

Paying the expense must remove the amount violation

Actual Result:

Paying the expense removed the amount violation, but it re-appeared later

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
Bug6902024_1753797937249.Screenrecorder-2025-07-29-19-27-56-979.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021953013986992609495
  • Upwork Job ID: 1953013986992609495
  • Last Price Increase: 2025-08-13
  • Automatic offers:
    • FitseTLT | Contributor | 108533959
Issue OwnerCurrent Issue Owner: @JmillsExpensify

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jul 29, 2025
  2. melvin-bot commented on Jul 29, 2025

    @melvin-bot

    Triggered auto assignment to @JmillsExpensify (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. FitseTLT commented on Jul 29, 2025

    @FitseTLT
    Contributor

    Proposal

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

    Expense - Paying the expense removed the amount violation, but it re-appeared later

    What is the root cause of that problem?

    We remove the violations when we pay optimstically so it disappears but the BE is adding it back so it re-appears.

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

    This can be solved in BE but we also avoid showing RBR's in FE when the iou report is settled ones like we do here


    So we can implement the same solution for MoneyRequestView
    const getErrorForField = useCallback(
    (field: ViolationField, data?: OnyxTypes.TransactionViolation['data'], policyHasDependentTags = false, tagValue?: string) => {

      if (isSettled) {
                    return '';
                }
    

    Similarly we can avoid showing receipt audit violations for settled report's.

    {shouldShowReceiptAudit && (
    <OfflineWithFeedback pendingAction={getPendingFieldAction('receipt')}>
    <ReceiptAudit
    notes={receiptViolations}
    shouldShowAuditResult={!!shouldShowAuditMessage}
    />
    </OfflineWithFeedback>

    {!!shouldShowAuditMessage && <ReceiptAuditMessages notes={receiptImageViolations} />}

    Or we can easily set receiptImageViolations, receiptViolations to be empty for settled reports here so that no receipt RBR will be shown.
    May be also the transaction error here but it is not a violation so we might still need to display it for settled reports too.
    And also avoid the RBR's in TransactionItemRow here
    <TransactionItemRowRBRWithOnyx
    transaction={transactionItem}
    containerStyles={[styles.mt2, styles.minHeight4]}
    missingFieldError={missingFieldError}
    />

    <TransactionItemRowRBRWithOnyx
    transaction={transactionItem}
    missingFieldError={missingFieldError}

    but if we want to show non-violation errors like the transaction errors we can explicitly avoid violations in case of a settled report in ViolationsUtils.getRBRMessages

    If needed we can also avoid RBRs for errors linked to settled reports in getReasonAndReportActionThatHasRedBrickRoad but for violations we are already not including settled report's violations in the calculation here.

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

    N / A

    What alternative solutions did you explore? (Optional)

  4. melvin-bot commented on Aug 1, 2025

    @melvin-bot

    @JmillsExpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  5. melvin-bot commented on Aug 5, 2025

    @melvin-bot

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

  6. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Aug 6, 2025
  7. changed the title [-]Expense - Paying the expense removed the amount violation, but it re-appeared later[/-] [+][$250] Expense - Paying the expense removed the amount violation, but it re-appeared later[/+] on Aug 6, 2025
  8. melvin-bot commented on Aug 6, 2025

    @melvin-bot
  9. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Aug 6, 2025
  10. melvin-bot commented on Aug 6, 2025

    @melvin-bot

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

  11. 32 remaining items

  12. melvin-bot commented on Oct 6, 2025

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  13. melvin-bot commented on Oct 6, 2025

    @melvin-bot

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

    If no regressions arise, payment will be issued on 2025-10-13. 🎊

    For reference, here are some details about the assignees on this issue:

  14. melvin-bot commented on Oct 6, 2025

    @melvin-bot

    @suneox / @FitseTLT @JmillsExpensify The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero 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]

  15. JmillsExpensify commented on Oct 16, 2025

    @JmillsExpensify
    Contributor

    Payment summary:

    • Contributor: $250 @FitseTLT via Upwork
    • Contributor+: $250 @suneox via New Expensify
  16. JmillsExpensify commented on Oct 16, 2025

    @JmillsExpensify
    Contributor

    Contributor paid out. @suneox mind commenting on the regression test?

  17. suneox commented on Oct 16, 2025

    @suneox
    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: N/A Cause by the logic was updated following backend changes.

    • [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.

    Regression Test Proposal

    Precondition:

    Test:

    1. Create a Workspace
    2. More feature -> enable rule
    3. Open Rules -> Update Max expense amount
    4. Create a manual expense has value greater than the value has updated from step 3
    5. Submit, approve and pay elsewhere via top dropdown
    6. Verify paying the expense will remove RBR from the LHN and report preview and transaction item from the transaction list but the violation will be seen on the details transaction view.

    Do we agree 👍 or 👎

  18. JmillsExpensify commented on Oct 17, 2025

    @JmillsExpensify
    Contributor

    Awesome thanks. Please request via ND!

  19. twisterdotcom commented on Oct 26, 2025

    @twisterdotcom
    Contributor

    @suneox has submitted payment for this report on ND here.

    SO: https://stackoverflowteams.com/c/expensify/questions/7582

    Zapier Logs Run ID: 00040eee-f690-af18-857b-81f7331e5081
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions