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
[Awaiting checklist] [$250] Distance - System message shows "changed the expense" after editing distance split #83500
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Version Number: 9.3.26-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:#82257 Email or phone of affected tester (no customers):sdjoisnjdosnjdosjoi@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.
Open any split.
Click Amount.
Click on the highlighted row.
Click Distance > edit waypoints > Save > Save.
Open the edited split.
Expected Result:
System message will show "changed the distance to y mi @ RM0.725 / mi (previously x mi @ RM0.725 / mi), which updated the amount to q (previously p)".
👋 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 introduced a regression in system messages for distance split expenses. While the PR successfully added distance and rate field handling for splits, it did not properly set the required fields (modifiedMerchant, modifiedAmount, modifiedCurrency) needed to generate detailed system messages when editing distance splits. This causes the generic "changed the expense" message instead of the expected detailed distance change message.
Labels: Keeping DeployBlockerCash (App deploy is blocked), removed DeployBlocker (not a backend issue)
Bug only appears on staging (9.3.26-0), not production (new feature)
Bug is specific to distance split expenses after editing distance
melvin-bot correctly identified and assigned this to the PR author
Root Cause
When updating distance split expenses, the system message generation code expects modifiedMerchant to be in distance format (e.g., "10 mi @ $0.725 / mi"). However, PR #82257 did not properly set this field during the split transaction update flow, causing the fallback to the generic "changed the expense" message instead of the detailed distance change message.
Please re-state the problem that we are trying to solve in this issue.
After editing waypoints on a distance split expense, the system message shows a generic "changed the expense" instead of the expected detailed message like "changed the distance to y mi @ RM0.725 / mi (previously x mi @ RM0.725 / mi), which updated the amount to q (previously p)".
What is the root cause of that problem?
When a split child transaction's waypoints are edited, the code flow through Split.ts → getUpdateMoneyRequestParams (IOU/index.ts) deliberately skips creating the optimistic MODIFIED_EXPENSE report action when waypoints are present in transactionChanges.
The evidence chain:
Split.ts:1308 calls getUpdateMoneyRequestParams with transactionChanges containing waypoints, merchant, amount, etc.
IOU/index.ts:4557 sets hasPendingWaypoints = true because 'waypoints' in transactionChanges
IOU/index.ts:4591-4592 builds the optimistic MODIFIED_EXPENSE report action
IOU/index.ts:4594: The condition if (!hasPendingWaypoints && ...) evaluates to false, so the built report action is discarded — it is not pushed to optimisticData and reportActionID is not set in apiParams
The comment at lines 4584-4590 explains the design intent:
We don't create a modified report action if we're updating the waypoints... there isn't valid optimistic mileage data we can use, and the report action is created on the server with the distance-related response from the MapBox API
This makes sense for non-split distance edits, where the server receives the UPDATE_MONEY_REQUEST_DISTANCE command, calls MapBox, computes the route, and generates the MODIFIED_EXPENSE action server-side. However, for split child transactions processed via the SplitTransaction API command, the server does not generate the distance-specific MODIFIED_EXPENSE action the same way, resulting in the generic fallback message.
What changes do you think we should make in order to solve the problem?
In src/libs/actions/IOU/index.ts:4594, the condition should be relaxed for split transactions to allow the optimistic MODIFIED_EXPENSE to be created even when waypoints are pending:
The check !hasPendingWaypoints should become (!hasPendingWaypoints || isSplitTransaction).
For split transactions, this is safe because the transactionChanges from the split flow already includes the recalculated merchant (the distance string like "10.00 mi @ $0.70 / mi") and amount from the split data. The existing message generation code in getModifiedExpenseOriginalMessage (ReportUtils.ts:5455-5471) will properly set originalMessage.merchant and originalMessage.amount from transactionChanges, and ModifiedExpenseMessage.ts:307 will detect the distance merchant format (contains @) and call getForDistanceRequest to produce the correct detailed message.
What alternative solutions did you explore? (Optional)
An alternative would be to fix the server-side SplitTransaction handler to generate the distance-specific MODIFIED_EXPENSE action for split child waypoint changes (similar to how UPDATE_MONEY_REQUEST_DISTANCE works). However, the frontend fix is simpler, more immediate, and consistent with how the split flow already handles other field changes optimistically.
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 [-][$250] Distance - System message shows "changed the expense" after editing distance split[/-][+][Awaiting checklist] [$250] Distance - System message shows "changed the expense" after editing distance split[/+]on Mar 17, 2026
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Test:
Go to staging.new.expensify.com
Go to a workspace chat
Create a map distance expense
Open the expense
Click More > Split > Save
Open any split
Click Amount
Click on the highlighted row
Click Distance > edit waypoints > Save > Save
Open the edited split
Verify the system message shows "changed the distance to y mi @ 0.725 / mi (previously x mi @ 0.725 / mi), which updated the amount to q (previously p)" instead of the generic "changed the expense"
Also verify that editing a non-split distance expense still works correctly
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Activity
melvin-bot commentedon Feb 25, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #82257
melvin-bot commentedon Feb 25, 2026
💬 A slack conversation has been started in #expensify-open-source
melvin-bot commentedon Feb 25, 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 25, 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 25, 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 introduced a regression in system messages for distance split expenses. While the PR successfully added distance and rate field handling for splits, it did not properly set the required fields (modifiedMerchant, modifiedAmount, modifiedCurrency) needed to generate detailed system messages when editing distance splits. This causes the generic "changed the expense" message instead of the expected detailed distance change message.
Labels: Keeping DeployBlockerCash (App deploy is blocked), removed DeployBlocker (not a backend issue)
Evidence
Root Cause
When updating distance split expenses, the system message generation code expects modifiedMerchant to be in distance format (e.g., "10 mi @ $0.725 / mi"). However, PR #82257 did not properly set this field during the split transaction update flow, causing the fallback to the generic "changed the expense" message instead of the detailed distance change message.
MelvinBot commentedon Feb 25, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
After editing waypoints on a distance split expense, the system message shows a generic "changed the expense" instead of the expected detailed message like "changed the distance to y mi @ RM0.725 / mi (previously x mi @ RM0.725 / mi), which updated the amount to q (previously p)".
What is the root cause of that problem?
When a split child transaction's waypoints are edited, the code flow through
Split.ts→getUpdateMoneyRequestParams(IOU/index.ts) deliberately skips creating the optimisticMODIFIED_EXPENSEreport action when waypoints are present intransactionChanges.The evidence chain:
Split.ts:1308callsgetUpdateMoneyRequestParamswithtransactionChangescontainingwaypoints,merchant,amount, etc.IOU/index.ts:4557setshasPendingWaypoints = truebecause'waypoints' in transactionChangesIOU/index.ts:4591-4592builds the optimistic MODIFIED_EXPENSE report actionIOU/index.ts:4594: The conditionif (!hasPendingWaypoints && ...)evaluates tofalse, so the built report action is discarded — it is not pushed tooptimisticDataandreportActionIDis not set inapiParamsThe comment at lines 4584-4590 explains the design intent:
This makes sense for non-split distance edits, where the server receives the
UPDATE_MONEY_REQUEST_DISTANCEcommand, calls MapBox, computes the route, and generates theMODIFIED_EXPENSEaction server-side. However, for split child transactions processed via theSplitTransactionAPI command, the server does not generate the distance-specificMODIFIED_EXPENSEaction the same way, resulting in the generic fallback message.What changes do you think we should make in order to solve the problem?
In
src/libs/actions/IOU/index.ts:4594, the condition should be relaxed for split transactions to allow the optimisticMODIFIED_EXPENSEto be created even when waypoints are pending:The check
!hasPendingWaypointsshould become(!hasPendingWaypoints || isSplitTransaction).For split transactions, this is safe because the
transactionChangesfrom the split flow already includes the recalculatedmerchant(the distance string like "10.00 mi @ $0.70 / mi") andamountfrom the split data. The existing message generation code ingetModifiedExpenseOriginalMessage(ReportUtils.ts:5455-5471) will properly setoriginalMessage.merchantandoriginalMessage.amountfromtransactionChanges, andModifiedExpenseMessage.ts:307will detect the distance merchant format (contains@) and callgetForDistanceRequestto produce the correct detailed message.What alternative solutions did you explore? (Optional)
An alternative would be to fix the server-side
SplitTransactionhandler to generate the distance-specificMODIFIED_EXPENSEaction for split child waypoint changes (similar to howUPDATE_MONEY_REQUEST_DISTANCEworks). However, the frontend fix is simpler, more immediate, and consistent with how the split flow already handles other field changes optimistically.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR, or@MelvinBot <your feedback>to refine this analysis.24 remaining items
[-][$250] Distance - System message shows "changed the expense" after editing distance split[/-][+][Awaiting checklist] [$250] Distance - System message shows "changed the expense" after editing distance split[/+]ShridharGoel commentedon Mar 20, 2026
BugZero Checklist:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: https://github.com/Expensify/App/pull/82257/changes#r2966112260
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Test:
Do we agree 👍 or 👎
melvin-bot commentedon Mar 20, 2026
@garrettmknight Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
melvin-bot commentedon Mar 20, 2026
@garrettmknight Whoops! This issue is 2 days overdue. Let's get this updated quick!
garrettmknight commentedon Mar 24, 2026
Payment summary:
JmillsExpensify commentedon Apr 6, 2026
$250 approved for @ShridharGoel