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
- Create an expense on New Expensify using Track distance and the map
- Enter any two waypoints and save the expense
- Open the same expense on Expensify Classic
- Manually update the distance value and save the expense
- Reopen the expense on New Expensify
- 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 Owner
Current 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
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 checkstransaction.routes.route0.distancefirst and returns it if present. Only if routes are empty does it fall back totransaction.comment.customUnit.quantity.When
UpdateTransactionis called (e.g. from Expensify Classic to manually update the distance), it updatescomment.customUnit.quantitybut does not clearroutes.route0.distance. Since the route distance has priority, the stale route value is displayed instead of the manually updated value.Reproduction Steps
Expected Behavior
The distance field should display the manually updated value from
comment.customUnit.quantity.Proposed Fix
Reverse the priority in
getDistanceInMeters: prefercomment.customUnit.quantitywhen it is set, and only fall back toroutes.route0.distancewhen there is no custom unit quantity.Related
Issue Owner
Current Issue Owner: @FitseTLTUpwork Automation - Do Not Edit