Skip to content

Distance - "Please fix the distance rate error" is shown when new rate is selected for splits #82122

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): sjoidnjsidjnosnjisjio@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:

Precondition:

  • Workspace has at least two distance rates.
  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Create a distance expense.
  4. Go to workspace settings > Distance rates.
  5. Delete the rate used in Step 3.
  6. Open the distance expense.
  7. Click More > Split.
  8. Open any split > click Rate > select the available rate > click Save.
  9. Repeat Step 8 for the other split.
  10. Click Save.

Expected Result:

User should be able to split the distance expense because new rate is selected for each split.

Actual Result:

"Please fix the distance rate error" is shown when new rate is selected for each split.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7074585_1770811618884.9.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 @heyjennahay (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: None

    Recommendation: REVERT

    PR #79099 introduced the ability to edit distance and rate fields for split expenses, but has a critical bug in the validation logic that blocks users from saving splits even after selecting valid rates.

    Labels: Removed DeployBlocker (backend label not applicable). Kept DeployBlockerCash (App deploy is blocked).

    📋 Detailed Analysis

    Evidence

    PR #79099 was merged on 2026-02-10 and added distance/rate editing functionality for split expenses. The issue reproduction steps directly involve the new feature (editing distance rate on splits), and the error message splitExpenseDistanceErrorModalDescription was added in this PR.

    Verification

    The bug occurs in the split expense flow added by PR #79099:

    • Affected files: src/pages/iou/SplitExpensePage.tsx, src/libs/actions/IOU/Split.ts, src/pages/iou/SplitExpenseEditPage.tsx
    • PR Handle the Distance and Rate fields for splits #79099 modifies all these files to add distance/rate editing for splits
    • The error condition hasCustomUnitOutOfPolicyViolation is checked in SplitExpensePage.tsx:140-141

    Root Cause

    When a user selects a new valid rate for each split expense, the individual split items in the splitExpenses array get updated with the new customUnitRateID. However, the parent transaction still retains the old (deleted) rate ID in its customUnit.customUnitRateID field.

    The violation check in SplitExpensePage.tsx line 140 checks violations on the parent transaction:

    const currentTransactionViolations = transactionViolations?.[`${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${transactionID}`] ?? [];
    const hasCustomUnitOutOfPolicyViolation = currentTransactionViolations.some((violation) => violation.name === CONST.VIOLATIONS.CUSTOM_UNIT_OUT_OF_POLICY);

    The CUSTOM_UNIT_OUT_OF_POLICY violation is set in ViolationsUtils.ts when a transaction has a customUnitRateID that doesnt exist in the policys distance rates (line 371-383). Since the parent transaction still has the deleted rate ID, the violation persists even though all child splits have been updated with valid rates.

    Expected behavior: When all split expenses have valid rates, the save should succeed.
    Actual behavior: The validation checks the parent transactions rate (which is deleted) instead of checking if all splits have valid rates.

    This is a logic error introduced by PR #79099 where the validation was not updated to account for the new split-level distance rate editing feature.

  7. lakchote commented on Feb 11, 2026

    @lakchote
    Contributor

    coming from #79099 cc @ZhenjaHorbach

  8. IuliiaHerets commented on Feb 11, 2026

    @IuliiaHerets

    @lakchote Chrome / v9.3.17-6
    Impossible to split the expense if the rate was deleted. Need to choose a new rate before the split

    Screen.Recording.2026-02-11.at.21.26.20.mp4
  9. lakchote commented on Feb 11, 2026

    @lakchote
    Contributor

    @lakchote Chrome / v9.3.17-6 Impossible to split the expense if the rate was deleted. Need to choose a new rate before the split

    This is expected with the revert of #79099

  10. Krishna2323 commented on Feb 12, 2026

    @Krishna2323
    Contributor

    @lakchote could you please re-open one of the blockers for payments? I reviewed the revert PR. Thanks!

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