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-07-02] Distance - After changing unit, Exclude commutes field shows the old unit #94267
Version Number: 9.4.17-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:#92496 Email or phone of affected tester (no customers):applausetester+khcategory19@applause.expensifail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.5 / Chrome App Component: Workspace Settings
Action Performed:
Precondition:
Log in with Epensifail account.
Enable Distance rates.
Go to staging.new.expensify.com
Go to workspace settings > Distance rates.
Click Settings.
Click Exclude commutes.
Click Exclude a fixed distance per claim.
Enter any mile.
Click Save.
Click Unit.
Change it to Kilometers.
Click Exclude commutes.
Click Save.
Expected Result:
After changing unit, Exclude commutes field will update the unit.
Actual Result:
After changing unit, Exclude commutes field shows the old unit.
After clicking Save button without changing the distance, it still shows the old unit.
👋 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:
Identify the pull request that introduced this issue and revert it.
The commuter exclusion stores its own unit snapshot (commuterExclusions.fixedDistanceUnit) captured at save time, and the Settings page summary prefers that snapshot over the live workspace unit. When you later change the workspace distance unit, the snapshot is never updated, so the summary keeps showing the old unit.
The backend doesn't actually track a per-exclusion unit — SetPolicyCommuterExclusionsParams sends only distance and commuterExclusionMethod. The exclusion distance is implicitly interpreted in the policy's current distance unit, so fixedDistanceUnit is a frontend-only display field that drifts out of sync the moment the unit changes.
This also explains the second symptom (saving without changing the value doesn't refresh the unit): the exclusion page's onSave short-circuits and never re-persists when the numeric value is unchanged.
The exclusion page's input suffix itself is already correct — it derives from the live workspaceUnit (PolicyCommuterExclusionsPage.tsx:56-68). Only the Settings-page summary is stale.
What changes do you think we should make in order to solve the problem?
Stop using the stored fixedDistanceUnit snapshot for display and always derive the unit from the policy's current distance unit (defaultUnit), which is what the backend actually interprets the stored distance against.
In PolicyDistanceRatesSettingsPage.tsx:124, change the summary unit from policy.commuterExclusions.fixedDistanceUnit ?? defaultUnit ?? … to use defaultUnit ?? … (the live custom unit).
Since fixedDistanceUnit no longer drives any display and is never sent to the backend, consider removing it entirely (the field, the value passed at PolicyCommuterExclusionsPage.tsx:104, and the type) to prevent it drifting out of sync again.
This makes the summary follow the workspace unit immediately, matching the expected result.
What alternative solutions did you explore? (Optional)
Open product question: changing the unit currently keeps the same numeric value (e.g. "5 mi" effectively becomes "5 km") rather than converting it (~8 km). The bug only asks for the displayed unit to update, and the backend has no per-exclusion unit to convert against, so the display fix above is the minimal correct change. If the team wants the value to actually convert on unit change, that's a larger change — likely updating commuterExclusions.fixedDistance (and re-calling the API) inside the unit-change flow in setPolicyDistanceRatesUnit — and should be confirmed with product/backend first.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/94267) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
changed the title [-]Distance - After changing unit, Exclude commutes field shows the old unit[/-][+][Due for payment 2026-07-02] Distance - After changing unit, Exclude commutes field shows the old unit[/+]on Jun 25, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.19-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@Gonals The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]
Activity
applause-bot commentedon Jun 23, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/8d69c08515c14976124a996831bab9deafedc505acb48e67dc997aecba5477ab
melvin-bot commentedon Jun 23, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #92496
melvin-bot commentedon Jun 23, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Jun 23, 2026
👋 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:
MelvinBot commentedon Jun 23, 2026
Proposal
What is the root cause of that problem?
The commuter exclusion stores its own unit snapshot (
commuterExclusions.fixedDistanceUnit) captured at save time, and the Settings page summary prefers that snapshot over the live workspace unit. When you later change the workspace distance unit, the snapshot is never updated, so the summary keeps showing the old unit.The backend doesn't actually track a per-exclusion unit —
SetPolicyCommuterExclusionsParamssends onlydistanceandcommuterExclusionMethod. The exclusion distance is implicitly interpreted in the policy's current distance unit, sofixedDistanceUnitis a frontend-only display field that drifts out of sync the moment the unit changes.This also explains the second symptom (saving without changing the value doesn't refresh the unit): the exclusion page's
onSaveshort-circuits and never re-persists when the numeric value is unchanged.Code references
PolicyDistanceRatesSettingsPage.tsx:120-127—unit: policy.commuterExclusions.fixedDistanceUnit ?? defaultUnit ?? …distancesent to API:DistanceRate.ts:541-545andDistanceRate.ts:581Policy.ts:1814-1815commuterExclusions:PolicyDistanceRateUnitPage.tsx:32-39PolicyCommuterExclusionsPage.tsx:99-106The exclusion page's input suffix itself is already correct — it derives from the live
workspaceUnit(PolicyCommuterExclusionsPage.tsx:56-68). Only the Settings-page summary is stale.What changes do you think we should make in order to solve the problem?
Stop using the stored
fixedDistanceUnitsnapshot for display and always derive the unit from the policy's current distance unit (defaultUnit), which is what the backend actually interprets the stored distance against.PolicyDistanceRatesSettingsPage.tsx:124, change the summaryunitfrompolicy.commuterExclusions.fixedDistanceUnit ?? defaultUnit ?? …to usedefaultUnit ?? …(the live custom unit).fixedDistanceUnitno longer drives any display and is never sent to the backend, consider removing it entirely (the field, the value passed atPolicyCommuterExclusionsPage.tsx:104, and the type) to prevent it drifting out of sync again.This makes the summary follow the workspace unit immediately, matching the expected result.
What alternative solutions did you explore? (Optional)
Open product question: changing the unit currently keeps the same numeric value (e.g. "5 mi" effectively becomes "5 km") rather than converting it (~8 km). The bug only asks for the displayed unit to update, and the backend has no per-exclusion unit to convert against, so the display fix above is the minimal correct change. If the team wants the value to actually convert on unit change, that's a larger change — likely updating
commuterExclusions.fixedDistance(and re-calling the API) inside the unit-change flow insetPolicyDistanceRatesUnit— and should be confirmed with product/backend first.Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/94267)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
chiragsalian commentedon Jun 23, 2026
Behind a beta, not a blocker. Reassigning to alberto since he's working on it.
7 remaining items
[-]Distance - After changing unit, Exclude commutes field shows the old unit[/-][+][Due for payment 2026-07-02] Distance - After changing unit, Exclude commutes field shows the old unit[/+]melvin-bot commentedon Jun 25, 2026
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Jun 25, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.19-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-07-02. 🎊
melvin-bot commentedon Jun 25, 2026
@Gonals The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]
melvin-bot commentedon Jun 30, 2026
@Gonals Eep! 4 days overdue now. Issues have feelings too...
melvin-bot commentedon Jul 2, 2026
@Gonals Still overdue 6 days?! Let's take care of this!
melvin-bot commentedon Jul 3, 2026
@Gonals Still overdue 6 days?! Let's take care of this!
melvin-bot commentedon Jul 3, 2026
@Gonals 6 days overdue. This is scarier than being forced to listen to Vogon poetry!
melvin-bot commentedon Jul 6, 2026
@Gonals 10 days overdue. Is anyone even seeing these? Hello?
Gonals commentedon Jul 7, 2026
This is fixed