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] Split distance - Error when creating new split with invalid waypoints offline #83538
Version Number: 9.3.26-4 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:#82257 Email or phone of affected tester (no customers):sodnnisnjdisjndonsjo@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 map distance expense.
Open the expense.
Click More > Split > Save.
Go offline.
Open any split.
Click Amount.
Click Add split.
Enter amount on the new split.
Click on the new split.
Click Distance.
Edit both waypoints to invalid address (random address) > Save > Save.
Click Save to create the new split.
Go online.
Expected Result:
The new split will be created with "Please enter valid address" violation.
Actual Result:
The new split cannot be created. Error shows up on all three splits.
👋 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: This is a new feature that does not exist in production (N/A)
Recommendation: REVERT
PR #82257 introduces the ability to handle distance and rate fields for split expenses. The bug occurs when creating a new split with invalid waypoints while offline - the error incorrectly displays on all three splits instead of only on the newly created split with invalid data. This suggests an issue with how violations/errors are being assigned or displayed for split transactions with invalid waypoint data.
Labels: This is a frontend bug as the fix requires changes to Expensify/App. Both DeployBlockerCash and DeployBlocker labels are currently applied. Since this bug is:
Not reproducible in production (new feature)
Caused by an App PR that introduced distance split functionality
The fix requires reverting or patching the App PR
The DeployBlocker label should be removed, keeping only DeployBlockerCash.
Detailed Analysis
Evidence
The issue explicitly states this is a "new feature, does not exist in prod"
New OPTIMISTIC_DISTANCE_SPLIT_TRANSACTION_ID constant
New SPLIT_DRAFT transaction state
New GetRouteForSplitDraft API command
Extensive changes to handle waypoints, customUnit, and distance calculations in splits
Root Cause
When a new split is created with invalid waypoints (null island coordinates at lat: 0, lng: 0), the violation/error state is being incorrectly propagated to all splits in the group rather than being isolated to the specific split with invalid data. The code in SplitExpensePage.tsx shows error handling logic that checks for distance transactions (!isDistance conditions), but the violation assignment logic for individual splits with invalid waypoints appears to be missing proper scoping.
The reproduction steps show that going offline, adding a split with invalid waypoints, then going online triggers the error on all splits - suggesting the error state is either:
Being set on the parent transaction rather than the child split
Not being properly filtered when displaying violations for each individual split
Being optimistically applied to all splits during the offline→online sync
Please re-state the problem that we are trying to solve in this issue.
When splitting a distance expense, going offline, adding a new split with invalid waypoints (random addresses), and then going back online, errors appear on all three splits instead of just the one with invalid waypoints. The new split cannot be created.
What is the root cause of that problem?
The updateSplitTransactions function in src/libs/actions/IOU/Split.ts accumulates failureData for all split transactions into a single shared onyxData object (lines 1115-1119, 1357-1359), then sends everything in oneAPI.write(WRITE_COMMANDS.SPLIT_TRANSACTION, ...) call (line 1675).
When the backend rejects this single API call (because one split has invalid waypoints), the Onyx update handler at src/libs/actions/OnyxUpdates.ts:54-74 applies allfailureData entries as a batch. Since buildOnyxDataForMoneyRequest (in src/libs/actions/IOU/index.ts:2466-2473) adds a generic error (iou.error.genericCreateFailureMessage) to each split transaction's failureData entry, every split ends up with an error — not just the one with invalid waypoints.
In short: the all-or-nothing nature of the single API call + batch failureData application means one bad split poisons the error state of all siblings.
What changes do you think we should make in order to solve the problem?
Add client-side waypoint validation in updateSplitTransactions (around src/libs/actions/IOU/Split.ts:1078-1089, where rate validation already exists) to check whether each split's waypoints are valid before making the API call. Specifically:
In updateSplitTransactions, before the loop that builds onyxData, validate each split's waypoints using getValidWaypoints() from TransactionUtils. If a split has waypoints but none are valid (no lat/lng), set an error on only that split's draft transaction and return early without calling the API.
This mirrors how rate validation is already handled at lines 1078-1089 of Split.ts — checking for valid data before proceeding with the API call.
This prevents the scenario where invalid waypoints are sent to the backend, which would reject the entire batch and propagate errors to all splits.
What alternative solutions did you explore? (Optional)
Modify failureData to be per-split: Instead of setting errors on all transactions in failureData, only set errors on the parent/original transaction. This is more invasive and could miss other failure scenarios.
Split into multiple API calls: Send each split as a separate API call so failures are isolated. This would be a larger architectural change and could introduce consistency issues.
Add per-split error display in SplitListItem: While useful for UX, this alone doesn't solve the root problem of all splits being marked as errored.
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 [-]Split distance - Error when creating new split with invalid waypoints offline[/-][+][$250] Split distance - Error when creating new split with invalid waypoints offline[/+]on Feb 26, 2026
Please re-state the problem that we are trying to solve in this issue.
When one newly added split has invalid waypoints offline, going online causes failure state/errors to appear across all sibling splits instead of only the invalid one.
What is the root cause of that problem?
updateSplitTransactions builds one shared onyxData object and accumulates failure entries from each split into that single request payload, then sends one SPLIT_TRANSACTION write. On non-200, Onyx applies the entire request failureData set, so sibling splits inherit failure state.
When UpdateSplitTransaction BE also doesn't store a valid value at 0:46 response at 1:20 and we need also handle on BE side or show error for batch expense also make sense
Activity
melvin-bot commentedon Feb 26, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #82257
melvin-bot commentedon Feb 26, 2026
💬 A slack conversation has been started in #expensify-open-source
melvin-bot commentedon Feb 26, 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 26, 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 26, 2026
Investigation Summary
Classification: Frontend bug
Causing PR: #82257 - "feat: handle the Distance and Rate fields for splits" by @ZhenjaHorbach (High confidence)
Related Issues: This is a new feature that does not exist in production (N/A)
Recommendation: REVERT
PR #82257 introduces the ability to handle distance and rate fields for split expenses. The bug occurs when creating a new split with invalid waypoints while offline - the error incorrectly displays on all three splits instead of only on the newly created split with invalid data. This suggests an issue with how violations/errors are being assigned or displayed for split transactions with invalid waypoint data.
Labels: This is a frontend bug as the fix requires changes to Expensify/App. Both
DeployBlockerCashandDeployBlockerlabels are currently applied. Since this bug is:The
DeployBlockerlabel should be removed, keeping onlyDeployBlockerCash.Detailed Analysis
Evidence
Verification
PR #82257 modifies multiple files related to split expense handling:
src/libs/actions/IOU/Split.ts- Core split logic with 326 additionssrc/pages/iou/SplitExpenseEditPage.tsx- UI for editing splitssrc/pages/iou/SplitExpensePage.tsx- Main split page flowsrc/pages/iou/request/step/IOURequestStepDistanceMap.tsx- Distance map handlingsrc/pages/iou/request/step/IOURequestStepWaypoint.tsx- Waypoint editingThe PR introduces:
OPTIMISTIC_DISTANCE_SPLIT_TRANSACTION_IDconstantSPLIT_DRAFTtransaction stateGetRouteForSplitDraftAPI commandRoot Cause
When a new split is created with invalid waypoints (null island coordinates at lat: 0, lng: 0), the violation/error state is being incorrectly propagated to all splits in the group rather than being isolated to the specific split with invalid data. The code in
SplitExpensePage.tsxshows error handling logic that checks for distance transactions (!isDistanceconditions), but the violation assignment logic for individual splits with invalid waypoints appears to be missing proper scoping.The reproduction steps show that going offline, adding a split with invalid waypoints, then going online triggers the error on all splits - suggesting the error state is either:
3 remaining items
MelvinBot commentedon Feb 26, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When splitting a distance expense, going offline, adding a new split with invalid waypoints (random addresses), and then going back online, errors appear on all three splits instead of just the one with invalid waypoints. The new split cannot be created.
What is the root cause of that problem?
The
updateSplitTransactionsfunction insrc/libs/actions/IOU/Split.tsaccumulatesfailureDatafor all split transactions into a single sharedonyxDataobject (lines 1115-1119, 1357-1359), then sends everything in oneAPI.write(WRITE_COMMANDS.SPLIT_TRANSACTION, ...)call (line 1675).When the backend rejects this single API call (because one split has invalid waypoints), the Onyx update handler at
src/libs/actions/OnyxUpdates.ts:54-74applies allfailureDataentries as a batch. SincebuildOnyxDataForMoneyRequest(insrc/libs/actions/IOU/index.ts:2466-2473) adds a generic error (iou.error.genericCreateFailureMessage) to each split transaction's failureData entry, every split ends up with an error — not just the one with invalid waypoints.In short: the all-or-nothing nature of the single API call + batch failureData application means one bad split poisons the error state of all siblings.
What changes do you think we should make in order to solve the problem?
Add client-side waypoint validation in
updateSplitTransactions(aroundsrc/libs/actions/IOU/Split.ts:1078-1089, where rate validation already exists) to check whether each split's waypoints are valid before making the API call. Specifically:updateSplitTransactions, before the loop that builds onyxData, validate each split's waypoints usinggetValidWaypoints()fromTransactionUtils. If a split has waypoints but none are valid (no lat/lng), set an error on only that split's draft transaction and return early without calling the API.Split.ts— checking for valid data before proceeding with the API call.This prevents the scenario where invalid waypoints are sent to the backend, which would reject the entire batch and propagate errors to all splits.
What alternative solutions did you explore? (Optional)
SplitListItem: While useful for UX, this alone doesn't solve the root problem of all splits being marked as errored.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 26, 2026
Current assignees @suneox and @ZhenjaHorbach are eligible for the External assigner, not assigning anyone new.
[-]Split distance - Error when creating new split with invalid waypoints offline[/-][+][$250] Split distance - Error when creating new split with invalid waypoints offline[/+]melvin-bot commentedon Feb 26, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022026914912690144254
jainam884 commentedon Feb 26, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When one newly added split has invalid waypoints offline, going online causes failure state/errors to appear across all sibling splits instead of only the invalid one.
What is the root cause of that problem?
updateSplitTransactionsbuilds one sharedonyxDataobject and accumulates failure entries from each split into that single request payload, then sends oneSPLIT_TRANSACTIONwrite. On non-200, Onyx applies the entire request failureData set, so sibling splits inherit failure state.App/src/libs/actions/IOU/Split.ts
Lines 1115 to 1119 in 9618ba6
App/src/libs/actions/IOU/Split.ts
Lines 1357 to 1359 in 9618ba6
App/src/libs/actions/OnyxUpdates.ts
Lines 57 to 74 in 9618ba6
What changes do you think we should make in order to solve the problem?
Isolate failure scope by request, not by post-failure UI filtering:
This removes the “one bad split poisons all siblings” failure mode directly.
What alternative solutions did you explore? (Optional)
Client-side pre-validation of waypoints is simpler, but it does not fully solve backend or sync-time single-request failure fan-out patterns.
suneox commentedon Feb 26, 2026
When
UpdateSplitTransactionBE also doesn't store a valid value at 0:46 response at 1:20 and we need also handle on BE side or show error for batch expense also make sense83538.1.mp4
puneetlath commentedon Feb 26, 2026
Demoting as BE issue. cc @lakchote
lakchote commentedon Feb 27, 2026
Will be fixed by https://github.com/Expensify/Web-Expensify/pull/51025 too.
garrettmknight commentedon Mar 17, 2026
Fixed, no C+ reviewer, closing.