You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-02-17] [$250] Expense-Distance is shown in miles on the confirm details page and in Km on the distance edit page #79868
Version Number: V9.3.4-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:https://test-management.browserstack.com/projects/2219752/folder/18717689/test-cases/49855697 Email or phone of affected tester (no customers):dreamnitethedragon+yydyd373@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Redminote 10S Android 13 App Component: Money Requests
Action Performed:
Pre-condition:
Have workspace with USD currency as default
Have a self DM
Launch app
Tap fab - track distance - manual
Note when workspace is selected, distance is shown in miles
Now change To field as self DM
Note Distance is shown in miles
Tap distance
Note edit distance page is shown in KM
Expected Result:
Distance must be shown in Km in confirm details & distance edit page on selecting self dm while creating track distance.
Actual Result:
Distance is shown in miles in confirm details page & in Km in distance edit page on selecting self dm while creating track distance.
Please re-state the problem that we are trying to solve in this issue.
When creating a track distance expense from a workspace with USD currency (which uses miles), and then changing the "To" field to self DM, the distance unit is inconsistent:
Confirmation page shows distance in miles
Edit distance page shows distance in km
Expected: Both pages should show distance in km when tracking to self DM (P2P rate).
What is the root cause of that problem?
In MoneyRequestConfirmationList.tsx, for track expenses, the policy is always set to policyForMovingExpenses regardless of whether the destination is a policy expense chat or a P2P chat (self DM):
This causes the unit to come from the workspace policy (miles for USD) even when tracking to self DM.
However, in IOURequestStepDistanceManual.tsx, the policy is correctly set to undefined for self DM (via usePolicy(report?.policyID)), which triggers P2P rates (km).
What changes do you think we should make in order to solve the problem?
We should modify the policy selection in MoneyRequestConfirmationList.tsx to not use policyForMovingExpenses when tracking to a P2P destination (self DM). Use isPolicyExpenseChat to determine the destination type:
constisTrackExpense=iouType===CONST.IOU.TYPE.TRACK;// For track expenses to P2P (non-policy) chats, don't use a policy so P2P rates are usedconstpolicy=isTrackExpense ? (isPolicyExpenseChat ? policyForMovingExpenses : undefined) : (policyReal??policyDraft);
What alternative solutions did you explore? (Optional)
N/A
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
Please re-state the problem that we are trying to solve in this issue.
When creating a manual distance expense, the confirm details step can show the distance in miles, but tapping into the distance edit screen shows the same distance in kilometers after changing the “To” field to a self DM. The unit is inconsistent across screens within the same flow.
What is the root cause of that problem?
The distance unit is being derived from two different sources:
The confirmation step prefers the unit stored on the transaction draft (comment.customUnit.distanceUnit).
The distance edit screen derives the unit from the effective rate (P2P rate vs workspace rate).
When the user switches the destination from a workspace to a self DM, the flow switches to a P2P distance rate, but the transaction draft’s stored distanceUnit is not updated accordingly. This leaves the confirmation step “stuck” on the old unit while the edit screen reflects the new effective unit.
What changes do you think we should make in order to solve the problem?
When the flow switches to the P2P distance rate (e.g. selecting a self DM), synchronize the transaction draft’s stored comment.customUnit.distanceUnit to match the effective P2P unit used by the edit screen.
For manual distance requests (where the quantity is stored in the selected unit), convert the stored comment.customUnit.quantity when the unit changes so the numeric value remains consistent.
This ensures both the confirm details step and the edit distance step display the same unit and value for the same draft transaction.
function setCustomUnitRateID(transactionID: string, customUnitRateID: string | undefined) {
const isFakeP2PRate = customUnitRateID === CONST.CUSTOM_UNITS.FAKE_P2P_ID;
const transaction = allTransactionDrafts[`${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${transactionID}`];
let nextDistanceUnit: Unit | undefined;
let nextQuantity: number | undefined;
// When switching to the fake P2P rate (e.g. moving from a workspace chat to a self-DM),
// ensure the transaction's distance unit matches the effective P2P unit so confirmation and edit screens stay consistent.
if (isFakeP2PRate && transaction) {
const currency = transaction.currency ?? CONST.CURRENCY.USD;
const p2pMileageRate = DistanceRequestUtils.getRateForP2P(currency, transaction);
nextDistanceUnit = p2pMileageRate.unit;
const existingDistanceUnit = transaction?.comment?.customUnit?.distanceUnit;
const existingQuantity = transaction?.comment?.customUnit?.quantity;
// For manual distance requests (no route distance stored in meters), the quantity is stored in the selected unit.
// Convert it when the effective unit changes to avoid showing miles on confirm and km on edit (or vice versa).
if (typeof existingQuantity === 'number' && existingDistanceUnit && nextDistanceUnit && existingDistanceUnit !== nextDistanceUnit && !transaction?.routes?.route0?.distance) {
const distanceInMeters = getDistanceInMeters(transaction, existingDistanceUnit);
const convertedQuantity = DistanceRequestUtils.convertDistanceUnit(distanceInMeters, nextDistanceUnit);
if (Number.isFinite(convertedQuantity)) {
nextQuantity = convertedQuantity;
}
}
}
Onyx.merge(`${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${transactionID}`, {
comment: {
customUnit: {
customUnitRateID,
...(!isFakeP2PRate && {defaultP2PRate: null}),
...(nextDistanceUnit && {distanceUnit: nextDistanceUnit}),
...(typeof nextQuantity === 'number' && {quantity: nextQuantity}),
},
},
});
}
What alternative solutions did you explore? (Optional)
changed the title [-]Expense-Distance is shown in miles on the confirm details page and in Km on the distance edit page[/-][+][$250] Expense-Distance is shown in miles on the confirm details page and in Km on the distance edit page[/+]on Jan 20, 2026
@mallenexpensify, I think it's eligible for 50% compensation to contributor and C+. #80466 was raised by @daledah to fix the issue but there was a regression so it was reverted, then #82692 was raised to fix the issue again but we put it on hold because major changes were being made under the same flow in #84136. Now the issue is fixedl
Activity
melvin-bot commentedon Jan 19, 2026
Triggered auto assignment to @bfitzexpensify (
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.daledah commentedon Jan 19, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When creating a track distance expense from a workspace with USD currency (which uses miles), and then changing the "To" field to self DM, the distance unit is inconsistent:
Expected: Both pages should show distance in km when tracking to self DM (P2P rate).
What is the root cause of that problem?
In MoneyRequestConfirmationList.tsx, for track expenses, the policy is always set to
policyForMovingExpensesregardless of whether the destination is a policy expense chat or a P2P chat (self DM):App/src/components/MoneyRequestConfirmationList.tsx
Lines 306 to 307 in 6e6f87c
This causes the unit to come from the workspace policy (miles for USD) even when tracking to self DM.
However, in IOURequestStepDistanceManual.tsx, the policy is correctly set to
undefinedfor self DM (viausePolicy(report?.policyID)), which triggers P2P rates (km).App/src/pages/iou/request/step/IOURequestStepDistanceManual.tsx
Line 107 in 6e6f87c
What changes do you think we should make in order to solve the problem?
We should modify the policy selection in
MoneyRequestConfirmationList.tsxto not usepolicyForMovingExpenseswhen tracking to a P2P destination (self DM). UseisPolicyExpenseChatto determine the destination type:What alternative solutions did you explore? (Optional)
N/A
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
annaweber830 commentedon Jan 19, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When creating a manual distance expense, the confirm details step can show the distance in miles, but tapping into the distance edit screen shows the same distance in kilometers after changing the “To” field to a self DM. The unit is inconsistent across screens within the same flow.
What is the root cause of that problem?
The distance unit is being derived from two different sources:
comment.customUnit.distanceUnit).When the user switches the destination from a workspace to a self DM, the flow switches to a P2P distance rate, but the transaction draft’s stored
distanceUnitis not updated accordingly. This leaves the confirmation step “stuck” on the old unit while the edit screen reflects the new effective unit.What changes do you think we should make in order to solve the problem?
comment.customUnit.distanceUnitto match the effective P2P unit used by the edit screen.comment.customUnit.quantitywhen the unit changes so the numeric value remains consistent.This ensures both the confirm details step and the edit distance step display the same unit and value for the same draft transaction.
App/src/libs/actions/IOU/index.ts
Lines 1344 to 1354 in eafbcff
What alternative solutions did you explore? (Optional)
yatin-italy commentedon Jan 19, 2026
Proposal
Restate the problem this issue is trying to solve.
What is the root cause of that problem?
What changes do you think we should make in order to solve the problem?
What alternative solutions did you explore? (Optional)
none
melvin-bot commentedon Jan 20, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022013558515922077933
[-]Expense-Distance is shown in miles on the confirm details page and in Km on the distance edit page[/-][+][$250] Expense-Distance is shown in miles on the confirm details page and in Km on the distance edit page[/+]melvin-bot commentedon Jan 20, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @thesahindia (
External)50 remaining items
mallenexpensify commentedon Apr 13, 2026
Requested retest and took
Reviewingoff. Let's see where that gets us....m-natarajan commentedon Apr 14, 2026
Not repro, Windows 11 Chrome and Iphone 12 Pro Max / IOS 26.3.1, v9.3.59-3
ScreenRecording_04-14-2026.10-53-42_1.MP4
14.04.2026_10.50.28_REC.mp4
mallenexpensify commentedon Apr 14, 2026
@thesahindia since the bug isn't reproducible, can we close? If you feel payment is due, provide detailed reasoning. Thx
thesahindia commentedon Apr 25, 2026
@mallenexpensify, I think it's eligible for 50% compensation to contributor and C+. #80466 was raised by @daledah to fix the issue but there was a regression so it was reverted, then #82692 was raised to fix the issue again but we put it on hold because major changes were being made under the same flow in #84136. Now the issue is fixedl
mallenexpensify commentedon Apr 27, 2026
Payment Summary
Contributor: @daledah due $125 via NewDot
Contributor+: @thesahindia due $125 via NewDot
Wow... this is confusing. I think 50% is fair because of the regression. Otherwise it likely would have been 100%.
Does this PR needed to be close?
quinthar commentedon Apr 28, 2026
Approved $125 for @daledah
garrettmknight commentedon Aug 7, 2026
$125 approved for @thesahindia