Skip to content

[HOLD Auth/pull/20597] Distance value displays route distance instead of manually updated distance #86568

Description

@neil-marcellini

Problem

When a user manually updates the distance value for a distance expense in Expensify Classic, the New Expensify app still displays the original route distance instead of the updated value.

Root Cause

In src/libs/TransactionUtils/getDistanceInMeters.ts, the function checks transaction.routes.route0.distance first and returns it if present. Only if routes are empty does it fall back to transaction.comment.customUnit.quantity.

When UpdateTransaction is called (e.g. from Expensify Classic to manually update the distance), it updates comment.customUnit.quantity but does not clear routes.route0.distance. Since the route distance has priority, the stale route value is displayed instead of the manually updated value.

Reproduction Steps

  1. Create an expense on New Expensify using Track distance and the map
  2. Enter any two waypoints and save the expense
  3. Open the same expense on Expensify Classic
  4. Manually update the distance value and save the expense
  5. Reopen the expense on New Expensify
  6. Observe the distance field still shows the original route distance, not the manually updated value

Expected Behavior

The distance field should display the manually updated value from comment.customUnit.quantity.

Proposed Fix

Reverse the priority in getDistanceInMeters: prefer comment.customUnit.quantity when it is set, and only fall back to routes.route0.distance when there is no custom unit quantity.

Related

Issue OwnerCurrent Issue Owner: @FitseTLT
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022037585935439351322
  • Upwork Job ID: 2037585935439351322
  • Last Price Increase: 2026-03-27

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributorsOverdue

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions