Skip to content

Expense-Receipt shows 2 duplicate stop points when expense is created with only 1 stop point. #103352

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: V9.5.4-0
Reproducible in staging?: Yes
Reproducible in production?: Unable to validate in Prod - Provide reasoning.
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #102258
Email or phone of affected tester (no customers): dreamnitethedragon+vegst@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Redmi note 10s android 13
App Component: Money Requests

Action Performed:

  1. Launch app
  2. Create a distance map expense with start and stop point in workspace chat
  3. Tap plus icon - track distance - map - add stop - select a destination
  4. Tap start and select a destination
  5. Note middle stop point is empty and tap create expense
  6. Open the expense - receipt
  7. Note 2 stop points shown with same destination

Expected Result:

One start and stop point must be shown in receipt.

Actual Result:

One start and 2 duplicate stop point is shown in receipt when expense is created with only 1 stop point.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7279916_1791369996933.Screenrecorder-2026-10-07-16-07-53-716.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Julia Ponikarchuk
Bug ID: 7279916

Activity

  1. applause-bot commented on Oct 7, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/d84e3c71e22993f6551df949af5da412a3585b933b34921b8c2c2be2364ac75e

  2. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Oct 7, 2026
  3. melvin-bot commented on Oct 7, 2026

    @melvin-bot

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

  4. melvin-bot commented on Oct 7, 2026

    @melvin-bot

    @Gonals @Pujan92 you have been assigned to this deploy blocker because you reviewed the offending PR: #102258

  5. melvin-bot commented on Oct 7, 2026

    @melvin-bot

    @ShridharGoel you have been assigned to this deploy blocker because you authored the offending PR: #102258

  6. melvin-bot commented on Oct 7, 2026

    @melvin-bot

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

  7. github-actions commented on Oct 7, 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.
  8. MelvinBot commented on Oct 7, 2026

    @MelvinBot
    Contributor

    Deploy Blocker Analysis

    Causing PR: [Payment due @Pujan92] Add Reuse route to the distance creation flow (Expensify/App#102258). It merged 2026-10-06 and ships in Deploy Checklist: New Expensify 2026-10-06. The auto-assignment is correct.

    Root cause: The PR shows "Add stop" before the start and stop have addresses. A new stop then lands in the wrong waypoint slot and leaves an empty gap. The receipt later shows that gap as a duplicate stop.

    Recommendation: Roll forward with a one-line fix. Show "Add stop" only when numberOfFilledWaypoints >= 2, and show "Reuse route" on its own condition. Revert only if a fix can't land quickly. A revert would also remove the whole Reuse route feature (42 files).

    Confidence: Medium-high. The code confirms how the gap forms. I didn't trace the exact step that copies the stop into the receipt.

    Investigation details
    1. "Add stop" now appears with empty waypoints. The PR changed the condition from numberOfFilledWaypoints >= 2 to (numberOfFilledWaypoints >= 2 || shouldShowReuseRoute). shouldShowReuseRoute is true when the user has any recent map distance expense, which repro step 2 creates. See DistanceRequestFooter.tsx:110-118.
    2. The new stop goes into the wrong slot. "Add stop" opens the editor at index Object.keys(waypoints).length. A new draft already has empty waypoint0 and waypoint1 (MoneyRequest.ts:441-444). So the stop is saved to waypoint2, the user fills waypoint0, and waypoint1 stays empty. That matches step 5, "middle stop point is empty".
    3. The gap appears as a duplicate. The receipt lists every key in transaction.comment.waypoints (DistanceEReceiptPanel.tsx:49-98). The result {A, B, B} fits the renumbered {A, B} being merged over the gapped {A, empty, B} without clearing waypoint2. The create path renumbers valid waypoints (TransactionUtils/index.ts:1284-1338). Route fetching still sends the gapped set, so older gap handling may be involved. Removing the gap fixes the bug either way.

    This also explains "Unable to validate in Prod". Production doesn't show "Add stop" at step 3, so testers can't follow the steps there.

    Ruled out: Split useExpenseSubmission hook still sends cleaned waypoints. Show save filters button when the current filters is no longer the default filters only renames a style. No other PR in the checklist touches waypoint code.

    Alternative fix: Open the waypoint editor at the first empty slot instead of keys.length.


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


    view run

  9. added and removed
    DeployBlockerCashThis issue or pull request should block deployment
    on Oct 7, 2026
  10. Gonals commented on Oct 7, 2026

    @Gonals
    Contributor

    Minor issue. Not blocking on it

  11. m-natarajan commented on Oct 10, 2026

    @m-natarajan

    Chrome, iPhone 13/iOS 26.6.2, v9.5.7-0
    No Add stop option when Start and Stop fields are empty

    bandicam.2026-10-10.21-43-57-745.mp4
    ScreenRecording_10-10-2026.16-33-40_1.mp4
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.DailyKSv2Engineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions