You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[$250] Distance - Split amounts do not auto redistribute when adding distance split #83690
Version Number: 9.3.26-8 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):osidnjodjosijsoji@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:
Go to staging.new.expensify.com
Go to workspace chat.
Create a manual expense.
Open the expense.
Click More > Split.
Click Add split.
→ All split amounts auto redistribute.
Create a manual distance expense.
Open the expense.
Click More > Split.
Click Add split.
Expected Result:
Split amounts will auto redistribute when adding distance split.
Actual Result:
Split amounts do not auto redistribute when adding distance split.
👋 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:
Identify the pull request that introduced this issue and revert it.
Classification: Frontend bug Causing PR: #82257 - "feat: handle the Distance and Rate fields for splits" by @ZhenjaHorbach (High confidence) Related Issues: None
Recommendation: REVERT
PR #82257 should be reverted. The PR introduced inconsistent behavior between manual and distance expense splits. When adding a new split to a manual expense, amounts auto-redistribute across all splits. However, for distance expenses, this auto-redistribution was intentionally disabled, creating a confusing user experience.
Labels: No changes needed. Keeping DeployBlockerCash (frontend bug blocking App deploy). This issue is not reproducible on production, confirming it was introduced by a PR currently on staging.
Detailed Analysis
Evidence
The issue states that split amounts auto-redistribute when adding a split to a manual expense, but NOT when adding a split to a distance expense. This inconsistency was introduced by PR #82257.
Verification
In /home/runner/_work/App/App/src/libs/actions/IOU/Split.ts, the addSplitExpenseField function at lines 2091-2094 contains this logic:
// Auto-redistribute amounts for all splits if this is not a distance requestif(!isDistanceRequest){redistributedSplitExpenses=redistributeSplitExpenseAmounts(updatedSplitExpenses,total,currency);}
This condition explicitly skips auto-redistribution for distance requests. The comment indicates this was intentional, but it creates an inconsistent user experience where:
Manual expense: Click "Add split" and amounts redistribute automatically
Distance expense: Click "Add split" and amounts do NOT redistribute
Root Cause
PR #82257 added comprehensive support for distance and rate fields in splits. As part of this work, the author intentionally disabled auto-redistribution for distance expenses (line 2092), likely because distance splits have additional complexity with distance/rate calculations. However, this created a UX inconsistency that users find confusing.
While the PR added valuable functionality for distance splits, the inconsistent behavior is confusing and blocks deployment. A revert allows time to properly address the UX inconsistency - either by enabling auto-redistribution for distance splits or by disabling it for all split types to maintain consistency.
Please re-state the problem that we are trying to solve in this issue.
When splitting a distance expense and clicking "Add split", the split amounts do not auto-redistribute. The new split is added with amount $0.00 and the existing splits keep their original amounts. This works correctly for manual expenses.
What is the root cause of that problem?
In src/libs/actions/IOU/Split.ts, the addSplitExpenseField function (which handles the "Add split" button) has an explicit if (!isDistanceRequest) guard at line 2092 that skips calling redistributeSplitExpenseAmounts for distance expenses:
let redistributedSplitExpenses = updatedSplitExpenses;
// Auto-redistribute amounts for all splits if this is not a distance request
if (!isDistanceRequest) {
redistributedSplitExpenses = redistributeSplitExpenseAmounts(updatedSplitExpenses, total, currency);
}
This means the newly added split stays at amount=0 with distance quantity=0, and existing splits are not rebalanced. The same guard exists in two other functions:
removeSplitExpenseField at line 2259 (removing a split)
updateSplitExpenseAmountField at line 2418 (editing a split's amount)
Notably, evenlyDistributeSplitExpenseAmounts at line 2113 (the "Make splits even" button) does not have this guard and correctly handles distance expenses — it redistributes amounts, then recalculates each split's distance and merchant via updateSplitExpenseDistanceFromAmount.
What changes do you think we should make in order to solve the problem?
In src/libs/actions/IOU/Split.ts, for each of the three affected functions (addSplitExpenseField, removeSplitExpenseField, updateSplitExpenseAmountField):
Remove the if (!isDistanceRequest) guard so redistributeSplitExpenseAmounts is called for all expense types
After redistribution, add distance-field recalculation for distance expenses — iterate over the redistributed splits and call updateSplitExpenseDistanceFromAmount to derive the correct customUnit.quantity and merchant from the new amount, following the exact pattern already implemented in evenlyDistributeSplitExpenseAmounts (lines 2148-2159)
What alternative solutions did you explore? (Optional)
An alternative would be to extend redistributeSplitExpenseAmounts itself to handle distance fields internally. However, that function is a pure amount-redistribution utility and adding distance awareness would mix concerns. The approach of keeping redistribution and distance-field recalculation as separate steps (as evenlyDistributeSplitExpenseAmounts already does) is cleaner and more consistent with the existing codebase patterns.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, or @MelvinBot <your feedback> to refine this analysis.
changed the title [-]Distance - Split amounts do not auto redistribute when adding distance split[/-][+][$250] Distance - Split amounts do not auto redistribute when adding distance split[/+]on Feb 27, 2026
Activity
melvin-bot commentedon Feb 27, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #82257
melvin-bot commentedon Feb 27, 2026
💬 A slack conversation has been started in #expensify-open-source
melvin-bot commentedon Feb 27, 2026
Triggered auto assignment to @sonialiap (
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.github-actions commentedon Feb 27, 2026
👋 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:
OSBotify commentedon Feb 27, 2026
Investigation Summary
Classification: Frontend bug
Causing PR: #82257 - "feat: handle the Distance and Rate fields for splits" by @ZhenjaHorbach (High confidence)
Related Issues: None
Recommendation: REVERT
PR #82257 should be reverted. The PR introduced inconsistent behavior between manual and distance expense splits. When adding a new split to a manual expense, amounts auto-redistribute across all splits. However, for distance expenses, this auto-redistribution was intentionally disabled, creating a confusing user experience.
Labels: No changes needed. Keeping
DeployBlockerCash(frontend bug blocking App deploy). This issue is not reproducible on production, confirming it was introduced by a PR currently on staging.Detailed Analysis
Evidence
The issue states that split amounts auto-redistribute when adding a split to a manual expense, but NOT when adding a split to a distance expense. This inconsistency was introduced by PR #82257.
Verification
In
/home/runner/_work/App/App/src/libs/actions/IOU/Split.ts, theaddSplitExpenseFieldfunction at lines 2091-2094 contains this logic:This condition explicitly skips auto-redistribution for distance requests. The comment indicates this was intentional, but it creates an inconsistent user experience where:
Root Cause
PR #82257 added comprehensive support for distance and rate fields in splits. As part of this work, the author intentionally disabled auto-redistribution for distance expenses (line 2092), likely because distance splits have additional complexity with distance/rate calculations. However, this created a UX inconsistency that users find confusing.
The PR modified 25 files including:
/home/runner/_work/App/App/src/libs/actions/IOU/Split.ts(added redistribution skip logic)/home/runner/_work/App/App/src/pages/iou/SplitExpensePage.tsxWhy Revert?
While the PR added valuable functionality for distance splits, the inconsistent behavior is confusing and blocks deployment. A revert allows time to properly address the UX inconsistency - either by enabling auto-redistribution for distance splits or by disabling it for all split types to maintain consistency.
MelvinBot commentedon Feb 27, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When splitting a distance expense and clicking "Add split", the split amounts do not auto-redistribute. The new split is added with amount $0.00 and the existing splits keep their original amounts. This works correctly for manual expenses.
What is the root cause of that problem?
In
src/libs/actions/IOU/Split.ts, theaddSplitExpenseFieldfunction (which handles the "Add split" button) has an explicitif (!isDistanceRequest)guard at line 2092 that skips callingredistributeSplitExpenseAmountsfor distance expenses:This means the newly added split stays at amount=0 with distance quantity=0, and existing splits are not rebalanced. The same guard exists in two other functions:
removeSplitExpenseFieldat line 2259 (removing a split)updateSplitExpenseAmountFieldat line 2418 (editing a split's amount)Notably,
evenlyDistributeSplitExpenseAmountsat line 2113 (the "Make splits even" button) does not have this guard and correctly handles distance expenses — it redistributes amounts, then recalculates each split's distance and merchant viaupdateSplitExpenseDistanceFromAmount.What changes do you think we should make in order to solve the problem?
In
src/libs/actions/IOU/Split.ts, for each of the three affected functions (addSplitExpenseField,removeSplitExpenseField,updateSplitExpenseAmountField):if (!isDistanceRequest)guard soredistributeSplitExpenseAmountsis called for all expense typesupdateSplitExpenseDistanceFromAmountto derive the correctcustomUnit.quantityandmerchantfrom the new amount, following the exact pattern already implemented inevenlyDistributeSplitExpenseAmounts(lines 2148-2159)What alternative solutions did you explore? (Optional)
An alternative would be to extend
redistributeSplitExpenseAmountsitself to handle distance fields internally. However, that function is a pure amount-redistribution utility and adding distance awareness would mix concerns. The approach of keeping redistribution and distance-field recalculation as separate steps (asevenlyDistributeSplitExpenseAmountsalready does) is cleaner and more consistent with the existing codebase patterns.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR, or@MelvinBot <your feedback>to refine this analysis.melvin-bot commentedon Feb 27, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @jjcoffee (
External)[-]Distance - Split amounts do not auto redistribute when adding distance split[/-][+][$250] Distance - Split amounts do not auto redistribute when adding distance split[/+]melvin-bot commentedon Feb 27, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022027384280847457211
puneetlath commentedon Feb 27, 2026
Closing: https://expensify.slack.com/archives/C01GTK53T8Q/p1772200661641949