Skip to content

Split - Split amounts do not auto redistribute after removing split #81251

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.11-23
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: #79273
Email or phone of affected tester (no customers): sdoijsdoijdsojsioj@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.1 / Chrome
App Component: Money Requests

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Create an expense.
  4. Open the expense report.
  5. Click More > Split.
  6. Click Add split.
  7. Click Add split.
  8. Open any split.
  9. Click Remove split.

Expected Result:

Split amounts will auto redistribute to match the total amount after removing split.

Actual Result:

Split amounts do not auto redistribute after removing split.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7064949_1770097664330.8.mp4

View all open jobs on GitHub

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    DeployBlockerIndicates it should block deploying the API
    on Feb 3, 2026
  2. melvin-bot commented on Feb 3, 2026

    @melvin-bot

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

  3. melvin-bot commented on Feb 3, 2026

    @melvin-bot

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

  4. melvin-bot commented on Feb 3, 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 3, 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 3, 2026

    @OSBotify
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #79273 - "feat: update amounts/percentages split logic to match OD" by @ikevin127 (High confidence)
    Related Issues: None

    Recommendation: REVERT

    PR #79273 introduced auto-redistribution logic for split expenses but only partially implemented it. The removeSplitExpenseField function was not updated with the redistribution logic, causing split amounts to not auto-redistribute when a split is removed.

    Labels: Removed DeployBlocker (this is a frontend bug requiring an App PR fix, not a backend fix)

    📋 Detailed Analysis

    Evidence

    PR #79273 added auto-redistribution logic to split expenses so that when users add or edit splits, the unedited splits automatically adjust to sum to 100% of the total amount. However, the implementation is incomplete.

    The PR updated:

    • ✅ addSplitExpenseField - redistributes amounts when adding a new split
    • ✅ updateSplitExpenseAmountField - redistributes amounts when editing a split
    • ❌ removeSplitExpenseField - NOT updated with redistribution logic

    Verification

    Affected file: src/libs/actions/IOU/index.ts

    Current removeSplitExpenseField function (lines 13056-13072):

    function removeSplitExpenseField(draftTransaction: OnyxEntry<OnyxTypes.Transaction>, splitExpenseTransactionID: string) {
        if (!draftTransaction || !splitExpenseTransactionID) {
            return;
        }
    
        const originalTransactionID = draftTransaction?.comment?.originalTransactionID;
    
        const splitExpenses = draftTransaction.comment?.splitExpenses?.filter((item) => item.transactionID !== splitExpenseTransactionID);
    
        Onyx.merge(`${ONYXKEYS.COLLECTION.SPLIT_TRANSACTION_DRAFT}${originalTransactionID}`, {
            comment: {
                splitExpenses,
                splitsStartDate: null,
                splitsEndDate: null,
            },
        });
    }

    This function simply filters out the removed split but does NOT redistribute the amounts among the remaining unedited splits.

    Expected behavior (from PR description):
    When a split is removed, the remaining unedited splits should auto-redistribute to match the total amount.

    Actual behavior (from bug report):
    Split amounts do not auto-redistribute after removing a split.

    Root Cause

    The removeSplitExpenseField function lacks the redistribution logic that calculates:

    1. Sum of manually edited splits
    2. Remaining amount after subtracting edited splits
    3. Redistribution of remaining amount among unedited splits

    This same logic exists in addSplitExpenseField (lines 13516-13532 in the PR diff) and updateSplitExpenseAmountField (lines 13708-13742 in the PR diff), but was not added to removeSplitExpenseField.

  7. removed
    DeployBlockerIndicates it should block deploying the API
    on Feb 3, 2026
  8. ikevin127 commented on Feb 3, 2026

    @ikevin127
    Contributor

    🟢 Not a deploy blocker - also wasn't part of the issue's scope, so this would have to be checked in OldDot: if the same thing happens on OD - this can be closed as NAB since the goal was to align auto-split-calculation functionality with OD.

  9. blimpich commented on Feb 3, 2026

    @blimpich
    Contributor

    Same thing does not happen on OldDot

    Screen.Recording.2026-02-03.at.10.07.39.AM.mov
  10. blimpich commented on Feb 3, 2026

    @blimpich
    Contributor
  11. m-natarajan commented on Feb 3, 2026

    @m-natarajan

    The expense is divided once, after which the amounts do not appear, even before deleting the slip. Windows 10 / Chrome
    v9.3.11-38

    repro.-.issue.81251.mp4
  12. blimpich commented on Feb 3, 2026

    @blimpich
    Contributor

    ^ This is the same behavior on prod, not a deploy blocker

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