Skip to content

Distance can be changed to 0 mile when splitting distance, but reverts to original amount #82116

Closed

Description

@mitarachim

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.3.17-0
Reproducible in staging?: Yes
Reproducible in production?: N/A - new feature, doesn't exist in prod
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #79099
Email or phone of affected tester (no customers): sdsjndosjonjisd@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.2 / Chrome
App Component: Money Requests

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Create a manual distance expense.
  4. Open the distance expense.
  5. Click More > Split.
  6. Click on any split row.
  7. Click Distance > enter 0 > Save.
    → 0 mile can be saved.
  8. Click Save > Save.
  9. Open the distance expense with 0 mi distance from Step 7.

Expected Result:

0 mile distance when editing the split should be saved.

Actual Result:

Distance can be changed to 0 mile when splitting distance, but it reverts to original amount after splitting the distance expense.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7074533_1770807474804.6.mp4

View all open jobs on GitHub

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    DeployBlockerIndicates it should block deploying the API
    on Feb 11, 2026
  2. melvin-bot commented on Feb 11, 2026

    @melvin-bot

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

  3. melvin-bot commented on Feb 11, 2026

    @melvin-bot

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

  4. melvin-bot commented on Feb 11, 2026

    @melvin-bot

    Triggered auto assignment to @dylanexpensify (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.

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

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Frontend bug
    Causing PR: #79099 - "Handle the Distance and Rate fields for splits" by @ZhenjaHorbach (High confidence)
    Related Issues: #78891 (original issue that PR #79099 was fixing)

    Recommendation: REVERT

    PR #79099 introduced a JavaScript falsy value bug that prevents saving 0-mile distances in split expenses. The code uses a conditional check that treats 0 as falsy, causing it to revert to the original distance value instead of saving 0.

    Labels: Keeping DeployBlockerCash (blocks App deploy). Removing DeployBlocker (does not block backend/Web deploy).

    Detailed Analysis

    Evidence

    PR #79099 was merged on 2026-02-10 and adds distance/rate field handling for split expenses. The issue appeared in version 9.3.17-0 (current staging) and is reproducible in staging but not in production (new feature). The timing, feature area, and symptoms all match.

    Verification

    The bug occurs in /home/runner/_work/App/App/src/libs/actions/IOU/Split.ts at lines 2255-2256 and 2292-2293, which were modified by PR #79099.

    Files affected by the bug:

    • src/libs/actions/IOU/Split.ts - Contains the faulty logic
    • src/pages/iou/SplitExpenseEditPage.tsx - UI where users edit split distances

    Confirmation that PR #79099 modified these files:

    • src/libs/actions/IOU/Split.ts - Modified (added 57 lines, deleted 4)
    • src/pages/iou/SplitExpenseEditPage.tsx - Modified (added 85 lines, deleted 6)

    Root Cause

    In src/libs/actions/IOU/Split.ts function updateSplitExpenseItem (around line 2255-2256):

    } else if (splitExpenseDraftTransaction?.comment?.customUnit?.quantity) {
        quantity = splitExpenseDraftTransaction?.comment?.customUnit?.quantity;

    The bug: When quantity is 0, the condition evaluates to false because 0 is falsy in JavaScript. This causes the code to skip setting the quantity value, leaving it as undefined.

    Later, at lines 2292-2293, the same falsy check happens:

    } else if (splitExpenseDraftTransaction?.comment?.customUnit?.quantity) {
        distanceInUnits = splitExpenseDraftTransaction.comment.customUnit.quantity;

    When distanceInUnits becomes undefined, the subsequent check at line 2296 (if (distanceInUnits !== undefined)) fails, preventing the amount from being recalculated. As a result, the split expense reverts to the original distance value instead of saving 0 miles.

    Fix needed: Change the conditions to explicitly check for undefined or null:

    } else if (splitExpenseDraftTransaction?.comment?.customUnit?.quantity !== undefined) {
  7. lakchote commented on Feb 11, 2026

    @lakchote
    Contributor

    coming from #79099 cc @ZhenjaHorbach

  8. IuliiaHerets commented on Feb 11, 2026

    @IuliiaHerets

    @lakchote Issue can't be repro, there's no distance in any split row. Windows 11 / Chrome and Samsung A52 / Android 14, v9.3.17-6

    distance.split.mp4
    split.distance.mp4
  9. suneox commented on Feb 19, 2026

    @suneox
    Contributor

    The expected result in this case should be to prevent saving a 0-mile distance the same create manual distance

  10. ZhenjaHorbach commented on Feb 19, 2026

    @ZhenjaHorbach
    Contributor

    The expected result in this case should be to prevent saving a 0-mile distance the same create manual distance

    Yes
    It's new requirements which came from this PR

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.EngineeringHourlyKSv2ReviewingHas a PR in review

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions