Skip to content

Expense - Editing amount into negative, shows amount differs from calculated distance error #83594

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: V9.3.26-4
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #82257
Email or phone of affected tester (no customers): dreamnitethedragon+yydyd373@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Redminote 10S Android 13
App Component: Money Requests

Action Performed:

  1. Launch app
  2. Create workpace
  3. Open workspace chat
  4. Create a report
  5. Create distance manual expense
  6. Open the expense
  7. Edit the amount
  8. Open the expense
  9. Tap more - split the expense
  10. Note amount differs from calculated distance error is not shown in split preview
  11. Create a report
    12.Create distance manual expense
    13.Open the expense
    14.Edit the amount by adding a "flip" to make amount negative
    15.Open the expense
  12. Tap more - split the expense
    17.Note amount differs from calculated distance error is shown in split preview

Expected Result:

Editing amount into negative, must not show amount differs from calculated distance error in split preview.

Actual Result:

Editing amount into negative, shows amount differs from calculated distance error in split preview but Editing amount into positive, dismiss amount differs from calculated distance error in split preview.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7089350_1772118464625.Screenrecorder-2026-02-26-20-27-55-808.mp4

View all open jobs on GitHub

Activity

  1. added
    DeployBlockerCash
    on Feb 26, 2026
  2. melvin-bot commented on Feb 26, 2026

    @melvin-bot

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

  3. melvin-bot commented on Feb 26, 2026

    @melvin-bot

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

  4. github-actions commented on Feb 26, 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.
  5. OSBotify commented on Feb 26, 2026

    @OSBotify
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #82257 - "feat: handle the Distance and Rate fields for splits" by @ZhenjaHorbach (High confidence)
    Related Issues: None identified

    Recommendation: REVERT

    PR #82257 introduced functionality to handle distance and rate fields for split expenses. However, it appears to have introduced inconsistent behavior in how the "Amount differs from calculated distance" violation is displayed for negative vs positive amounts in the split preview.

    Labels: Keeping DeployBlockerCash as this is a frontend bug requiring an App PR fix

    📋 Detailed Analysis

    Evidence

    The issue is reproducible on staging (v9.3.26-4) but not production, and only affects split expenses created from distance transactions where the amount has been manually edited. The causing PR #82257 was merged on 2026-02-24 and is included in the current staging deploy.

    The melvin-bot comment confirms this was the causing PR and assigned it to the PR author.

    Verification

    PR #82257 modified the following key files related to split expense handling:

    • src/libs/actions/IOU/Split.ts (326 additions, 37 deletions)
    • src/pages/iou/SplitExpenseEditPage.tsx (100 additions, 4 deletions)
    • src/pages/iou/SplitExpensePage.tsx (39 additions, 12 deletions)
    • src/libs/TransactionUtils/index.ts (51 additions, 5 deletions)
    • Distance request step files for handling distance/rate in splits

    These changes directly relate to the affected functionality: splitting distance expenses.

    Root Cause

    The PR added logic to handle distance and rate fields for split expenses, including validation for distance rate violations. However, the implementation appears to have inconsistent behavior when validating the modifiedAmount violation (CONST.VIOLATIONS.MODIFIED_AMOUNT) for distance transactions:

    • When amount is edited to a positive value: The "Amount differs from calculated distance" error is correctly dismissed
    • When amount is edited to a negative value: The error is incorrectly shown in the split preview

    This suggests the validation logic for detecting when an amount differs from the calculated distance is not properly handling the negative amount case, likely due to absolute value comparisons or sign handling in the new split expense flow.

    The expected behavior (per the issue description) is that editing amount to negative should NOT show this error, just as editing to positive does not show it.

  6. lakchote commented on Feb 26, 2026

    @lakchote
    Contributor

    Discussing in here, demoting as it's unlikely a customer wants to do that.

  7. added
    Daily
    and removed
    DeployBlockerCash
    Hourly
    on Feb 26, 2026
  8. lakchote commented on Feb 26, 2026

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

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions