Skip to content

Distance - No error when creating distance with invalid waypoints from reuse route #103263

Open

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. Go offline.
  4. Create a distance expense with invalid waypoints.
  5. Go online.
  6. Wait for the expense to be created.
  7. Click + > Track distance > Map.
  8. Click Reuse route.
  9. Select the route with invalid waypoints.
  10. Click Create expense.
  11. Open the expense.

Expected Result:

In Step 10, error should show up when creating distance with invalid waypoints.

Actual Result:

In Step 10, error does not show up when creating distance with invalid waypoints. User can proceed with invalid waypoints.
In Step 11, there is no error on the expense preview.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7279440_1791325835608.2.mp4

View all open jobs on GitHub

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

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    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/ddaa5de97f941cff32138946e1fd7a3a13462f4f8faf0ef91249638b52ef0aac

  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 Map tab (Expensify/App#102258), by ShridharGoel. It merged on 2026-10-06 and is in the 9.5.4-0 checklist. No other PR in this release touches Reuse route. Confidence: high.

    Recommendation: revert. The feature is new, has no beta check, and the PR is also named in two other open blockers. Fixing forward would take several separate fixes.

    Root cause: Selecting a reused route sets isReusedRoute: true. useFetchRoute then skips getRoute, so errorFields.route is never set. The new Reuse route page also skips the Map step's route-error check. Confirmation blocks submit only when there is a route error, so invalid waypoints go through.

    Investigation details

    All links point to merge commit 8b3fdd9a.

    1. Invalid waypoints are saved. Offline, the waypoint page saves the typed address without coordinates and expects the backend to fill them in later. If the address can't be resolved, the expense keeps those waypoints. Reuse route later returns them.
    2. Selecting the route sets the flag. ReusableDistanceRoutes.ts:47-53 copies the waypoints and distance into the draft and sets isReusedRoute: true. The route type has no field that says whether the route is valid.
    3. The route fetch is skipped. useFetchRoute.ts:44 adds !transaction?.isReusedRoute to shouldFetchRoute. Confirmation uses the same hook (IOURequestStepConfirmation.tsx:627), so the fetch is skipped there too.
    4. The Map step's checks are bypassed. The Map tab blocks Next on a route error, duplicate waypoints, or loading (IOURequestStepDistanceMap.tsx:319-329). IOURequestStepReuseRoute.tsx:143-161 calls navigateToNextStep() as soon as the draft is written.
    5. Confirmation finds no error. Submit is blocked only if (!!routeError ...) (useConfirmationValidation.ts:188), and routeError comes from errorFields.route (useConfirmationListData.ts:152). The draft has no stored route, so it also counts as "pending route" (useDistanceRequestState.ts:127). That skips the amount check (useConfirmationValidation.ts:318).

    The expense preview shows no error because the App never records a route error. I didn't check what the server does with the request.

    Other open blockers from the same PR:

    If you fix forward instead, the minimum is:

    • Stop skipping getRoute for reused routes, or set isReusedRoute only when every waypoint has coordinates and the distance is above 0.
    • Run the Map step's checks on the Reuse route page before calling navigateToNextStep().

    A revert also removes: the web map crash fix in MapViewImpl.web.tsx, and the waypoint clean-up in useWaypointItems and updateWaypoints. Re-land these with the feature.

    I didn't run the app. The code path alone shows that the reuse flow turns off the only check that produces this error.


    Next Steps: Revert the PR above, or reply with @MelvinBot <your feedback> to refine this analysis.


    view run

  9. 8 remaining items

  10. melvin-bot commented on Oct 12, 2026

    @melvin-bot

    @Pujan92, @Gonals, @ShridharGoel Eep! 4 days overdue now. Issues have feelings too...

  11. melvin-bot commented on Oct 14, 2026

    @melvin-bot

    @Pujan92, @Gonals, @ShridharGoel Still overdue 6 days?! Let's take care of this!

  12. Gonals commented on Oct 15, 2026

    @Gonals
    Contributor

    @ShridharGoel, are you working on this?

  13. ShridharGoel commented on Oct 15, 2026

    @ShridharGoel
    Contributor

    Will pick this one soon, can we move this to weekly since it is unlikely to happen for real users and does not block any feature?

  14. melvin-bot commented on Oct 20, 2026

    @melvin-bot

    @Pujan92 @Gonals @ShridharGoel this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

  15. melvin-bot commented on Oct 20, 2026

    @melvin-bot

    @Pujan92, @Gonals, @ShridharGoel Huh... This is 4 days overdue. Who can take care of this?

  16. expensify-chore-bot commented on Nov 17, 2026

    @expensify-chore-bot

    This issue has not been updated in over 15 days. @Pujan92, @Gonals, @ShridharGoel eroding to Monthly issue.

    P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

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.EngineeringMonthlyKSv2ReviewingHas a PR in review

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions