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-07] Distance rates - Extra decimals are added to the distance after saving the distance #94270
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 10.88.
Click Save.
Expected Result:
No extra decimals will be added to the distance after saving the distance.
Actual Result:
Extra decimals are added to the distance after saving the distance.
👋 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.
Root Cause: The extra decimals are introduced by the backend (Auth), not the App. The App sends the distance exactly as typed — distance: 10.88 with no client-side conversion (DistanceRate.ts:581) — and the optimistic Onyx value is the clean number, which is why the value looks correct until the server responds. As the code comment notes, "the distance unit is owned by the workspace's distance custom unit (Auth resolves it server-side…)" (DistanceRate.ts:525-527). Auth stores the distance canonically in meters and converts back to the workspace unit (miles) on read. 10.88 mi → 17509.72… m → 10.8799999… mi is a classic IEEE-754 round-trip rounding error, and that imprecise value overwrites the clean optimistic value once the server response merges into Onyx.
Recommended Fix: The correct, canonical fix is in Auth (outside this repo) — round the value when converting meters back to the workspace unit before returning it. Since this is a backend change, please escalate to an internal engineer with Auth access to confirm and fix the round-trip conversion in the SetPolicyCommuterExclusions command path.
Optional App-side mitigation (to unblock the deploy faster): The App could format the distance for display/prefill to strip float noise (e.g. round to a sensible precision before rendering at PolicyDistanceRatesSettingsPage.tsx:123 and PolicyCommuterExclusionsPage.tsx:64). This masks the symptom rather than fixing the stored value, so it should be paired with the Auth fix, not used in place of it.
setPolicyCommuterExclusions writes that clean number optimistically and sends distance: 10.88 to the API (DistanceRate.ts:541-581). No miles→meters conversion happens client-side.
There is no successData override of fixedDistance — successData only clears pendingFields (DistanceRate.ts:559-567). So the only way the displayed value changes from the clean 10.88 is the policy commuterExclusions data returned in the API response merging over it.
That returned value is the Auth-resolved one (meters→miles), carrying the float precision error → user sees extra decimals.
Alternative explanations considered & ruled out:
Client-side parsing/formatting bug — ruled out: Number("10.88") is exact, and the value is correct optimistically; the change only appears after the server round-trip.
Optimistic data wrong — ruled out: optimistic value is the literal clean input.
Confidence: Medium-High. Strong code evidence + an explicit code comment stating Auth resolves the value server-side. Not confirmed against production logs — the VictoriaLogs MCP server isn't available in this runner, so the exact returned value (e.g. 10.8799999…) couldn't be captured. An internal engineer can confirm by inspecting the SetPolicyCommuterExclusions response for the affected workspace.
Next Steps: Reply with @MelvinBot implement the App-side display mitigation if you want a draft PR for the temporary frontend fix, or @MelvinBot <feedback> to refine. The real fix belongs in Auth — please loop in an internal engineer with Auth access.
changed the title [-]Distance rates - Extra decimals are added to the distance after saving the distance[/-][+][Due for payment 2026-07-07] Distance rates - Extra decimals are added to the distance after saving the distance[/+]on Jun 30, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.24-0 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/351228b3ac270a6da236417459f4e69b907e1b8cba21947fd6872b5ed1c03ef8
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
Issue Analysis
Root Cause: The extra decimals are introduced by the backend (Auth), not the App. The App sends the distance exactly as typed —
distance: 10.88with no client-side conversion (DistanceRate.ts:581) — and the optimistic Onyx value is the clean number, which is why the value looks correct until the server responds. As the code comment notes, "the distance unit is owned by the workspace's distance custom unit (Auth resolves it server-side…)" (DistanceRate.ts:525-527). Auth stores the distance canonically in meters and converts back to the workspace unit (miles) on read.10.88 mi → 17509.72… m → 10.8799999… miis a classic IEEE-754 round-trip rounding error, and that imprecise value overwrites the clean optimistic value once the server response merges into Onyx.The App then renders that value verbatim with no rounding in two places — the settings summary (
PolicyDistanceRatesSettingsPage.tsx:123) and the input prefill (PolicyCommuterExclusionsPage.tsx:64) — so whatever Auth returns is shown as-is.Recommended Fix: The correct, canonical fix is in Auth (outside this repo) — round the value when converting meters back to the workspace unit before returning it. Since this is a backend change, please escalate to an internal engineer with Auth access to confirm and fix the round-trip conversion in the
SetPolicyCommuterExclusionscommand path.Optional App-side mitigation (to unblock the deploy faster): The App could format the distance for display/prefill to strip float noise (e.g. round to a sensible precision before rendering at
PolicyDistanceRatesSettingsPage.tsx:123andPolicyCommuterExclusionsPage.tsx:64). This masks the symptom rather than fixing the stored value, so it should be paired with the Auth fix, not used in place of it.Investigation details & evidence chain
Evidence chain (input → bug → symptom):
10.88; the page parses it withNumber(trimmed)→ exactly10.88(PolicyCommuterExclusionsPage.tsx:92).setPolicyCommuterExclusionswrites that clean number optimistically and sendsdistance: 10.88to the API (DistanceRate.ts:541-581). No miles→meters conversion happens client-side.successDataoverride offixedDistance—successDataonly clearspendingFields(DistanceRate.ts:559-567). So the only way the displayed value changes from the clean10.88is the policycommuterExclusionsdata returned in the API response merging over it.Alternative explanations considered & ruled out:
Number("10.88")is exact, and the value is correct optimistically; the change only appears after the server round-trip.Confidence: Medium-High. Strong code evidence + an explicit code comment stating Auth resolves the value server-side. Not confirmed against production logs — the VictoriaLogs MCP server isn't available in this runner, so the exact returned value (e.g.
10.8799999…) couldn't be captured. An internal engineer can confirm by inspecting theSetPolicyCommuterExclusionsresponse for the affected workspace.Next Steps: Reply with
@MelvinBot implement the App-side display mitigationif you want a draft PR for the temporary frontend fix, or@MelvinBot <feedback>to refine. The real fix belongs in Auth — please loop in an internal engineer with Auth access.chiragsalian commentedon Jun 23, 2026
Behind a beta, not a blocker. Reassigning to alberto since he's working on it.
8 remaining items
[-]Distance rates - Extra decimals are added to the distance after saving the distance[/-][+][Due for payment 2026-07-07] Distance rates - Extra decimals are added to the distance after saving the distance[/+]melvin-bot commentedon Jun 30, 2026
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Jun 30, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.24-0 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-07. 🎊
melvin-bot commentedon Jun 30, 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 Jul 3, 2026
@Gonals Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
melvin-bot commentedon Jul 4, 2026
@Gonals Whoops! This issue is 2 days overdue. Let's get this updated quick!
melvin-bot commentedon Jul 7, 2026
@Gonals 6 days overdue. This is scarier than being forced to listen to Vogon poetry!
melvin-bot commentedon Jul 9, 2026
@Gonals Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!
Gonals commentedon Jul 10, 2026
Fixed