Skip to content

Distance expense can be created with first two empty waypoints #103262

Closed

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: 9.5.4-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: #102258
Email or phone of affected tester (no customers): sodjinosdjiojiosjio@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.5 / Chrome
App Component: Money Requests

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Create a distance expense.
  4. Click + > Track distance > Map.
  5. Without entering Start and Stop waypoint, click Add stop.
  6. Enter waypoint and save it.
  7. Click Add stop, enter waypoint and save it.
  8. Click Next > Create expense.
  9. Open the expense.
  10. Click Distance.

Expected Result:

In Step 8, user should be blocked from creating distance expense with the first two waypoints empty.

Actual Result:

In Step 8, user can create expense with the first two waypoints empty.
In Step 10, the first two empty waypoints are populated with the waypoint in Step 6 and 7.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7279442_1791325836918.4.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Mita Rachim
Bug ID: 7279442

Activity

  1. added
    DeployBlockerCash
    Bug
    on Oct 6, 2026
  2. applause-bot commented on Oct 6, 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/c1b488f70bb9fa1d72f4a4995005b3f8d3ce4d3e6d988c73c7b3066c786c4d1b

  3. melvin-bot commented on Oct 6, 2026

    @melvin-bot

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

  4. melvin-bot commented on Oct 6, 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 6, 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 6, 2026

    @melvin-bot

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

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

    @MelvinBot
    Contributor

    Deploy Blocker Investigation

    Causing PR: Add Reuse route to the distance creation flow (high confidence). It is in the Deploy Checklist: New Expensify 2026-10-06.

    Root cause: The PR shows Add stop before Start and Stop are filled, when the user has a reusable route (DistanceRequestFooter.tsx:110-119). New stops are added after the two empty waypoints. Validation only counts filled waypoints, so two filled stops pass (useWaypointValidation.ts:41). On submit, getValidWaypoints drops the empty waypoints and renumbers the filled stops as Start and Stop.

    Recommendation: Roll forward with a one-line fix, not a revert. Keep Add stop visible, but disable it until Start and Stop are filled:

    const isAddStopDisabled = numberOfWaypoints === MAX_WAYPOINTS || numberOfFilledWaypoints < 2;

    Deploy blocker? Yes. Production renders Add stop only when numberOfFilledWaypoints >= 2, so this is a regression rather than part of a new feature. Impact is moderate: the UX is confusing, but route, distance, and amount stay consistent.

    Investigation details

    How it happens (staging SHA 079ddb5c):

    1. A new draft starts with empty waypoint0 and waypoint1 (MoneyRequest.ts:441-444).
    2. Add stop renders when numberOfFilledWaypoints >= 2 || shouldShowReuseRoute. Production checks only the first condition (production L104-L108). shouldShowReuseRoute is true only in Track distance > Map (IOURequestStepDistanceMap.tsx:387). The account also needs at least one map distance expense from the last 90 days.
    3. Add stop uses the waypoint key count as its index, so the new stops become waypoint2 and waypoint3.
    4. atLeastTwoDifferentWaypointsError is validatedWaypoints.length < 2. It doesn't check where the empty waypoints are, so submitWaypoints lets the user continue (IOURequestStepDistanceMap.tsx:318-329).
    5. getValidWaypoints(waypoints, true) removes the empty waypoints and renumbers the rest (TransactionUtils/index.ts:1284-1314). useDistanceSubmission.ts:178 uses it. That's why the empty Start and Stop show the step 6 and 7 addresses later.

    Responsible commit: 91a78b0504d ("Always show Add stop and fit route thumbnail") removed the numberOfFilledWaypoints >= 2 guard. Product asked for this in the PR discussion. The fix above keeps the button visible as product requested.

    Other staging PRs ruled out: Analyzing is incorrectly shown after creating expense and enabling auto categorizing offline and Show save filters button when the current filters is no longer the default filters touch the same files, but they don't change waypoint gating or validation.

    Optional extra fix: In useWaypointValidation, block Next when Start or the last waypoint is empty and two or more other waypoints are filled.


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


    view run

  9. melvin-bot commented on Oct 6, 2026

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

  10. JmillsExpensify commented on Oct 7, 2026

    @JmillsExpensify
    Contributor

    Worth fixing though I also don't think it needs to be a deploy blocker. There is a "start" and "stop" in this instance.

  11. added
    Daily
    and removed
    DeployBlockerCash
    Hourly
    on Oct 7, 2026
  12. m-natarajan commented on Oct 7, 2026

    @m-natarajan

    Chrome / v9.5.4-2, Passed

    bandicam.2026-10-07.21-25-38-823.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugDailyEngineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions