Skip to content

[$250] [Due for payment 2026-03-11] Distance- "Please remove duplicate waypoints" remains after rearranging waypoints via keyboard #80165

Closed

Description

@mitarachim

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

Action Performed:

  1. Go to staging.new.expensify.com
  2. Click + > Track distance > Map.
  3. Enter the waypoint - A > B > B.
  4. Press Tab until it reaches Start waypoint.
  5. Press keyboard space, down arrow, and Enter.
  6. Press Enter again.

Expected Result:

"Please remove duplicate waypoints" will disappear because the waypoints are now B > A > B.

Actual Result:

"Please remove duplicate waypoints" does not disappear when the waypoints are now B > A > B.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7055111_1769038448828.2.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @nyomanjyotisa
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022031823558572194473
  • Upwork Job ID: 2031823558572194473
  • Last Price Increase: 2026-03-11

Activity

  1. added
    DeployBlockerCash
    Daily
    Bug
    DeployBlocker
    on Jan 21, 2026
  2. melvin-bot commented on Jan 21, 2026

    @melvin-bot

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

  3. melvin-bot commented on Jan 21, 2026

    @melvin-bot

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

  4. melvin-bot commented on Jan 21, 2026

    @melvin-bot

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

  5. github-actions commented on Jan 21, 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.
  6. OSBotify commented on Jan 21, 2026

    @OSBotify
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #79793 - "feat: implement keyboard reordering for DraggableList" by @MobileMage (High confidence)
    Related Issues: None

    Recommendation: REVERT

    PR #79793 added keyboard reordering functionality to the DraggableList component by registering KeyboardSensor with sortableKeyboardCoordinates. While this feature works correctly for reordering, it exposed an issue where the duplicate waypoint error message does not clear after keyboard reordering removes adjacent duplicates (e.g., A > B > B becomes B > A > B).

    Labels: Keeping DeployBlockerCash (Frontend bug). Removing DeployBlocker (not a backend issue).

    📋 Detailed Analysis

    Evidence

    The bug is reproducible only on staging where PR #79793 was deployed. The reproduction steps involve using the new keyboard reordering feature (Space to drag, arrow keys to move, Enter to drop) which was introduced by this PR.

    Verification

    PR #79793 modified /home/runner/work/App/App/src/components/DraggableList/index.tsx:

    • Added KeyboardSensor with sortableKeyboardCoordinates to enable keyboard-based waypoint reordering
    • Changed from single useSensor to useSensors array to support both pointer and keyboard input

    The bug manifests specifically when using keyboard reordering to fix duplicate waypoints. When waypoints A > B > B are reordered to B > A > B via keyboard:

    1. The waypoints are correctly reordered (B > A > B)
    2. The validatedWaypoints should update to reflect no duplicates
    3. However, the "Please remove duplicate waypoints" error remains visible

    Root Cause

    The validation logic in IOURequestStepDistanceMap.tsx uses useFetchRoute hook which calls getValidWaypoints(). This function filters out adjacent duplicate waypoints.

    When keyboard reordering happens:

    1. updateWaypoints() sets optimistic waypoints with the new order
    2. useFetchRoute recalculates validatedWaypoints
    3. duplicateWaypointsError is computed as: nonEmptyWaypointsCount >= 2 && Object.keys(validatedWaypoints).length !== nonEmptyWaypointsCount
    4. The effect at line 229-234 that should clear the error has a condition that prevents clearing when duplicateWaypointsError is true
    5. This creates a state where the waypoints are valid but the error persists

    The keyboard reordering feature introduced by PR #79793 works correctly, but it revealed this validation/error-clearing issue that likely existed before but was harder to trigger with mouse-based reordering.

  7. removed
    DeployBlocker
    on Jan 21, 2026
  8. 31 remaining items

  9. changed the title [-][Due for payment 2026-03-11] Distance- "Please remove duplicate waypoints" remains after rearranging waypoints via keyboard[/-] [+][$250] [Due for payment 2026-03-11] Distance- "Please remove duplicate waypoints" remains after rearranging waypoints via keyboard[/+] on Mar 11, 2026
  10. melvin-bot commented on Mar 11, 2026

    @melvin-bot
  11. johncschuster commented on Mar 11, 2026

    @johncschuster
    Contributor

    Payment Summary

  12. MobileMage commented on Mar 11, 2026

    @MobileMage
    Contributor
  13. johncschuster commented on Mar 13, 2026

    @johncschuster
    Contributor

    Thanks, @MobileMage! I've sent the offer. Once accepted, I'll get payment issued!

  14. MobileMage commented on Mar 16, 2026

    @MobileMage
    Contributor
  15. trjExpensify commented on Mar 16, 2026

    @trjExpensify
    Contributor

    approved $250 for @jayeshmangwani.

  16. johncschuster commented on Mar 16, 2026

    @johncschuster
    Contributor

    @jayeshmangwani do we require any regression test steps? If so, can you provide them?

  17. jayeshmangwani commented on Mar 17, 2026

    @jayeshmangwani
    Contributor

    @johncschuster Yes, we should add regression tests here. Adding them below:

  18. jayeshmangwani commented on Mar 17, 2026

    @jayeshmangwani
    Contributor

    Regression Test Proposal

    Tests:

    Test Case 1: Keyboard Reordering

    1. Press FAB, then select Track distance → Map
    2. Add two waypoints (e.g., “Philadelphia” and “Boston”)
    3. Press Tab until the Start waypoint is focused
    4. Press Space to start keyboard drag
    5. Press ArrowDown to move it
    6. Press Space to complete the reorder
    7. Verify that reordering works correctly with no errors

    Test Case 2: Drag and Drop

    1. Press FAB, then select Track distance → Map
    2. Add two waypoints (e.g., “Philadelphia” and “Boston”)
    3. Press Tab until the Start waypoint is focused
    4. Press Space to start keyboard drag
    5. Press ArrowDown to move it
    6. Press Space to complete the reorder
    7. Long-press on the start or stop point and try to drag it
    8. Verify that the waypoint can be dragged

    Test Case 3: Duplicate Waypoints Handling

    1. Press FAB, then select Track distance → Map
    2. Enter waypoints: A → B → B
    3. Verify that the error message “Please remove duplicate waypoints” appears above the Next button
    4. Press Tab until the Start waypoint is focused
    5. Press Space to start rearranging
    6. Press ArrowDown to move it
    7. Press Space to complete the rearrangement
    8. Verify that the error message disappears when the order becomes B → A → B

    Do we agree 👍 or 👎

  19. johncschuster commented on Mar 18, 2026

    @johncschuster
    Contributor

    Thank you! I've created an issue for those steps. We're all done here! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentBugDailyEngineeringExternalHelp Wanted

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions