Skip to content

[Due for payment 2026-07-16] [$250] Distance - Error in Manual tab persists after entering waypoints in Map tab #90558

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

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Create a map distance expense.
  4. Open the expense.
  5. Click Distance.
  6. Clear both waypoints.
  7. Go to Manual tab.
  8. Click Save.
  9. Go to Map tab.
  10. Enter both waypoints.
  11. Go to Manual tab.

Expected Result:

"Please enter at least two different addresses" in Manual tab should disappear after entering both waypoints in Map tab.

Actual Result:

"Please enter at least two different addresses" in Manual tab persists after entering both waypoints in Map tab.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7153100_1778687587410.11.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on May 13, 2026
  2. melvin-bot commented on May 13, 2026

    @melvin-bot

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

  3. melvin-bot commented on May 13, 2026

    @melvin-bot

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

  4. github-actions commented on May 13, 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.
  5. OSBotify commented on May 13, 2026

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Frontend bug
    Causing PR: #90131 - "fix: resolve distance edit regressions" by @mukhrr (High confidence)
    Related Issues: #90082, #90083, #90056, #90105

    Recommendation: REVERT

    PR #90131 introduced new logic in IOURequestStepDistance.tsx to handle the manualFormError state, including setting "Please enter at least two different addresses" when waypoints are invalid on the Manual tab. However, the error is cleared only via handleManualInputChange (when the user types in the manual input field) or by submitManualDistance resetting isManuallyEditing.current. There is no effect or logic to clear manualFormError when the Map tab waypoints become valid again. As a result, after clearing waypoints (triggering the error on Manual tab), re-entering valid waypoints on the Map tab does not clear the persisted error state on the Manual tab — the error lingers.

    The bug is staging-only and does not exist in production since this is a new feature per the issue report.

    Assigned: @mukhrr (PR author), @aimane-chnaif and @youssef-lr (approving reviewers)
    Labels: DeployBlockerCash kept (App PR caused the regression). No label changes needed.

    Detailed Analysis

    Evidence

    • The melvin-bot already identified PR fix: resolve distance edit regressions  #90131 as the causing PR (auto-assigned based on the regression test linked in the issue body: https://github.com/Expensify/App/pull/90131).
    • PR fix: resolve distance edit regressions  #90131 was merged on 2026-05-12 and modifies src/pages/iou/request/step/IOURequestStepDistance.tsx — the exact file implementing the distance edit flow.
    • The issue is marked "Reproducible in staging? Yes" and "N/A - new feature, doesn't exist in prod", placing it squarely within this staging-only PR's changes.

    Verification

    • Affected file: src/pages/iou/request/step/IOURequestStepDistance.tsx
    • PR fix: resolve distance edit regressions  #90131 modifies exactly this file (confirmed via gh pr view 90131 --json files).
    • The PR introduced submitManualDistance's early-return path at line 525 which calls setManualFormError(translate('iou.error.atLeastTwoDifferentWaypoints')) when atLeastTwoDifferentWaypointsError is true.
    • The only place manualFormError is cleared is in handleManualInputChange (triggered by typing in the manual input) and implicitly reset when submitManualDistance succeeds — neither of which fires when the user switches back to the Map tab and enters valid waypoints.
    • There is no useEffect watching atLeastTwoDifferentWaypointsError to clear manualFormError when the error resolves.

    Root Cause

    PR #90131 added validation in submitManualDistance that sets manualFormError to "Please enter at least two different addresses" when waypoints are invalid (step 525-527 in IOURequestStepDistance.tsx). However, no corresponding cleanup logic was added to clear this error when the user returns to the Map tab and enters valid waypoints. The atLeastTwoDifferentWaypointsError flag becomes false once two valid, different waypoints are entered, but manualFormError (a React useState value) is never reset in response to that change. The fix would require either a useEffect watching atLeastTwoDifferentWaypointsError to clear manualFormError when it becomes false, or clearing manualFormError when the user switches tabs. Reverting PR #90131 is the safest immediate path since the PR touches multiple interacting behaviors.

  6. MelvinBot commented on May 13, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    The manualFormError state in IOURequestStepDistance.tsx is only cleared when the user types in the manual distance input field (handleManualInputChange at line 631). There is no code path that clears it when waypoints become valid on the Map tab.

    The existing useEffect at line 272 correctly clears shouldShowAtLeastTwoDifferentWaypointsError (Map tab error) when waypoints change, but it does not also clear manualFormError. So when the user fixes waypoints on the Map tab and returns to Manual, the stale error persists.

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

    In the useEffect at line 272-277, also clear manualFormError alongside shouldShowAtLeastTwoDifferentWaypointsError when the waypoint validation conditions are no longer met (i.e., when waypoints become valid). This ensures both error states are reset when waypoints change, regardless of which tab the user is on.

    Investigation details

    Error set at line 524-527: when submitting from Manual tab with invalid waypoints (introduced in PR #90131).

    Only clearing path is line 631-637 (handleManualInputChange), which only fires on manual input typing.

    No tab-change callback exists on the OnyxTabNavigator at line 695 to reset errors when switching tabs.


    Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.

  7. aimane-chnaif commented on May 13, 2026

    @aimane-chnaif
    Contributor

    Similar issue was reported during original PR review - #89858 (comment) (reversed behavior)

  8. 47 remaining items

  9. melvin-bot commented on Jul 14, 2026

    @melvin-bot

    @aimane-chnaif Huh... This is 4 days overdue. Who can take care of this?

  10. melvin-bot commented on Jul 15, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  11. melvin-bot commented on Jul 15, 2026

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@mallenexpensify)

    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/2073473370662123024/hired)
    • I have verified the PR was not reverted
    • I have applied any discounts due to bugs/regressions introduced by this PR
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  12. mallenexpensify commented on Jul 17, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @aimane-chnaif due $250 via NewDot

    @aimane-chnaif plz complete the BZ checklist and tag me in a post once you have. Thx

  13. aimane-chnaif commented on Jul 18, 2026

    @aimane-chnaif
    Contributor

    BugZero Checklist:

    Regression Test Proposal

    Test:

    1. Go to workspace chat.
    2. Create a map distance expense.
    3. Open the expense.
    4. Click Distance.
    5. Clear both waypoints.
    6. Go to Manual tab.
    7. Click Save.
    8. Observe that error message shows
    9. Go to Map tab.
    10. Enter both waypoints.
    11. Go to Manual tab.
    12. Verify that error message in Manual tab disappears after entering both waypoints in Map tab.

    Do we agree 👍 or 👎

    cc: @mallenexpensify

    Zapier Logs Run ID: 00040eee-decb-a351-deb5-73b87e957504
  14. garrettmknight commented on Aug 7, 2026

    @garrettmknight
    Contributor

    $250 approved for @aimane-chnaif

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething 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