Skip to content

[$250] Expense - Waypoints added while splitting is not shown in distance receipt #83610

Closed

Description

@lanitochka17

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: V9.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): dreamnitethedragon+yydyd373@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Redminote 10S Android 13
App Component: Money Requests

Action Performed:

  1. Launch app
  2. Login with expensifail account
  3. Create a workspace
  4. Open workspace chat
  5. Create a distance map expense
  6. Open the expense
  7. Tap more - split
  8. Tap first expense - distance - add a stop "your location" & save
  9. Tap split expense
  10. Open the expense
  11. Tap receipt and note only 2 waypoints are shown
  12. Tap distance and note 3 waypoints are shown

Expected Result:

Waypoints added while splitting must be shown in distance receipt.

Actual Result:

Waypoints added while splitting is not shown in distance receipt.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7089473_1772130052076.Screenrecorder-2026-02-26-23-37-30-9.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @ikevin127
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022027097927677363650
  • Upwork Job ID: 2027097927677363650
  • Last Price Increase: 2026-02-26

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Feb 26, 2026
  2. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Feb 26, 2026
  3. melvin-bot commented on Feb 26, 2026

    @melvin-bot

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

  4. melvin-bot commented on Feb 26, 2026

    @melvin-bot

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

  5. melvin-bot commented on Feb 26, 2026

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @ikevin127 (External)

  6. melvin-bot commented on Feb 26, 2026

    @melvin-bot

    Triggered auto assignment to @trjExpensify (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.

  7. changed the title [-]Expense - Waypoints added while splitting is not shown in distance receipt[/-] [+][$250] Expense - Waypoints added while splitting is not shown in distance receipt[/+] on Feb 26, 2026
  8. melvin-bot commented on Feb 26, 2026

    @melvin-bot
  9. github-actions commented on Feb 26, 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.
  10. OSBotify commented on Feb 26, 2026

    @OSBotify
    Contributor

    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 introduced split distance expenses

    Recommendation: REVERT

    This PR introduced the ability to handle distance and rate fields for split expenses. The bug affects the split distance expense flow where waypoints added during editing are not properly displayed in the distance receipt.

    Labels: DeployBlockerCash label should be kept (this is a frontend App bug that requires an App PR to fix)

    Evidence

    The bug occurs when editing a split distance expense and adding waypoints - the distance view shows all waypoints correctly but the receipt view only shows the original waypoints, missing newly added ones.

    PR #82257 was identified by melvin-bot as the causing PR and introduced comprehensive changes to handle distance fields in split expenses, modifying 25 files including src/libs/actions/IOU/Split.ts (326 additions, 37 deletions).

    The PR was merged on 2026-02-24 and the issue was reported on 2026-02-26, confirming it is part of the current staging release.

    Root Cause

    When editing a split expense and adding waypoints, they are stored in modifiedWaypoints in the draft transaction. However, when the split transaction is finalized, these waypoints from modifiedWaypoints are not being properly transferred to the final transaction comment.waypoints structure. The ConfirmedRoute component reads from transaction.comment.waypoints for displaying the receipt, causing it to show stale waypoint data.

  11. OSBotify commented on Feb 26, 2026

    @OSBotify
    Contributor

    Label Decision

    No label changes are needed. The current labels are correct:

    • KEEP DeployBlockerCash: This is a frontend App bug caused by PR feat: handle the Distance and Rate fields for splits #82257. According to the decision tree, when an App PR causes the issue, we keep DeployBlockerCash to block the App deploy.
    • The issue is not reproducible in production (it is a new feature that does not exist in prod yet), which further confirms we should keep the label to prevent shipping this broken feature.

    Next Steps

    The PR author @ZhenjaHorbach should be engaged to either:

    1. Quickly provide a fix for the waypoint synchronization issue, or
    2. Revert PR feat: handle the Distance and Rate fields for splits #82257 to unblock the deploy

    The bug is in /home/runner/_work/App/App/src/libs/actions/IOU/Split.ts where modifiedWaypoints need to be properly transferred to the split expense waypoints when the transaction is finalized.

  12. MelvinBot commented on Feb 26, 2026

    @MelvinBot
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    When splitting a distance expense, if the user adds a new waypoint to one of the split items (e.g., adding a 3rd stop), the receipt view only shows the original 2 waypoints while the distance field correctly shows all 3 waypoints.

    What is the root cause of that problem?

    The root cause is in getMoneyRequestInformation in src/libs/actions/IOU/index.ts. When destructuring transactionParams (lines 3350-3375), the waypoints field is not included in the destructuring, even though:

    1. Split.ts correctly passes waypoints: splitExpense.waypoints at lines 1186 and 1218
    2. The RequestMoneyTransactionParams type includes waypoints?: WaypointCollection (line 471)

    Because waypoints is never extracted, it is never forwarded to buildOptimisticTransaction (lines 3509-3534). The buildOptimisticTransaction function in TransactionUtils/index.ts would correctly set commentJSON.waypoints = waypoints (line 498-499) if it received them — but it doesn't.

    Subsequently, fastMerge(existingTransaction, optimisticTransaction) at lines 3555-3572 merges the original parent transaction (with only 2 waypoints) into the child. Since the optimistic child has undefined for comment.waypoints, fastMerge preserves the original parent's stale waypoints. The child transaction is then stored to Onyx with only the original 2 waypoints.

    The receipt view (DistanceEReceipt at src/components/DistanceEReceipt.tsx:38) reads from transaction.comment.waypoints on the persisted transaction, showing only 2 waypoints. Meanwhile, the distance edit view (IOURequestStepDistance at src/pages/iou/request/step/IOURequestStepDistance.tsx:88-109) reads from SPLIT_TRANSACTION_DRAFT which has the correct 3 waypoints.

    What changes do you think we should make in order to solve the problem?

    In getMoneyRequestInformation in src/libs/actions/IOU/index.ts:

    1. Add waypoints to the destructuring of transactionParams (at line 3374, alongside customUnit)
    2. Include waypoints in the transactionParams object passed to buildOptimisticTransaction (at line 3533, alongside customUnit)

    This ensures that when Split.ts passes modified waypoints for a split child, they flow through to buildOptimisticTransaction, which sets commentJSON.waypoints correctly. The optimistic child transaction will then have the updated waypoints, and fastMerge will preserve them (since source values take precedence over target values for defined keys).

    What alternative solutions did you explore? (Optional)

    An alternative would be to have DistanceEReceipt check modifiedWaypoints in addition to comment.waypoints, similar to how getUpdatedTransaction in TransactionUtils handles waypoint changes. However, this would be a workaround rather than fixing the actual data flow issue — the child transaction should have the correct waypoints from the start.


    Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, or @MelvinBot <your feedback> to refine this analysis.

  13. puneetlath commented on Feb 26, 2026

    @puneetlath
    Contributor
  14. lakchote commented on Mar 16, 2026

    @lakchote
    Contributor

    We can close this one (see video test here).

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.EngineeringExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributorsHourlyKSv2ReviewingHas a PR in review

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions