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-09-16] Each US distance rate appears twice after copying distance rates from USD workspace #99285
Version Number: 9.4.59-1 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:#97936 Email or phone of affected tester (no customers):sjodijsnonjioidosjiji@gmail.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:
Create a USD workspace.
Enable Distance rates.
Enable Auto-update government rates in Distance rates > Settings.
Go to staging.new.expensify.com
Create a non-USD workspace.
Go to workspace settings > More features.
Enable Distance rates.
Go back to workspace list.
Click 3-dot menu on USD workspace > Copy settings.
Select the non-USD workspace in Step 2 > Next.
Select Distance rates > Next > Copy settings.
Wait for copy to complete.
Go to non-USD workspace settings > Distance rates.
Expected Result:
Each US distance rate will appear only once because source has one expired rate and one active rate while non-USD workspace has neither of the rates.
Actual Result:
Each US distance rate appears twice after copying settings from USD workspace to non-USD workspace.
A source rate with no name match on the target doesn't keep the source's customUnitRateID — it gets a freshly generated one. The source rate ID never survives the copy either way. The unit ID works the same when the target has no distance unit at all.
So both kinds of rate duplicate, for the same reason: the client holds the rate under the source's ID, the server persists it under a different one, and the push is an Onyx merge of customUnits keyed by rate ID, so nothing removes the client's copy.
That matches what was reported: the target workspace had neither US rate, so those were the new rates — and they're the ones that showed up twice.
This is why the draft PR has two halves rather than one:
Source rate whose name is already on the target → write it under the target's rate ID. This mirrors Auth exactly and covers the rates the target already had.
Source rate with no name match (and the whole unit when the target has none) → leave it out of the optimistic patch. The client can't reproduce generateID(), so any ID it invents becomes a second row when the push lands. Those rates appear when the server response arrives instead.
The alternative for (2) is to send client-generated rate IDs to the backend and have Auth persist them — the pattern setWorkspaceDistanceAutoUpdate already uses, which exists for exactly this reason. That keeps the instant preview for brand-new rates, at the cost of an Auth change plus a per-target ID map for multi-target copies.
changed the title [-]Each US distance rate appears twice after copying distance rates from USD workspace[/-][+][Due for payment 2026-09-16] Each US distance rate appears twice after copying distance rates from USD workspace[/+]on Sep 9, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.74-2 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-09-16. 🎊
The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ 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 Aug 24, 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/ff7932208c205706b8a2e8fe1605cf41da6fc32a2f048b3657e9f9417ab39aa0
melvin-bot commentedon Aug 24, 2026
@neil-marcellini recently merged #97936, but they are OOO right now, so I'll auto-assign someone else.
melvin-bot commentedon Aug 24, 2026
Triggered auto assignment to @grgia (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.melvin-bot commentedon Aug 24, 2026
@neil-marcellini @thelullabyy you have been assigned to this deploy blocker because you reviewed the offending PR: #97936
melvin-bot commentedon Aug 24, 2026
@Krishna2323 you have been assigned to this deploy blocker because you authored the offending PR: #97936
melvin-bot commentedon Aug 24, 2026
💬 A slack conversation has been started in #expensify-open-source
11 remaining items
neil-marcellini commentedon Sep 1, 2026
(Neil's AI agent)
A nuance worth spelling out, because it's easy to read the copy code and conclude that only pre-existing rates can duplicate.
Auth re-keys every rate it copies, not just the ones it can match to the target. From
copyCustomUnitPreservingIDs:A source rate with no name match on the target doesn't keep the source's
customUnitRateID— it gets a freshly generated one. The source rate ID never survives the copy either way. The unit ID works the same when the target has no distance unit at all.So both kinds of rate duplicate, for the same reason: the client holds the rate under the source's ID, the server persists it under a different one, and the push is an Onyx merge of
customUnitskeyed by rate ID, so nothing removes the client's copy.That matches what was reported: the target workspace had neither US rate, so those were the new rates — and they're the ones that showed up twice.
This is why the draft PR has two halves rather than one:
generateID(), so any ID it invents becomes a second row when the push lands. Those rates appear when the server response arrives instead.The alternative for (2) is to send client-generated rate IDs to the backend and have Auth persist them — the pattern
setWorkspaceDistanceAutoUpdatealready uses, which exists for exactly this reason. That keeps the instant preview for brand-new rates, at the cost of an Auth change plus a per-target ID map for multi-target copies.neil-marcellini commentedon Sep 1, 2026
I'll move ahead with only the App PR. We don't need optimistic updates for the new rates because the app does the copying under a blocking modal.
neil-marcellini commentedon Sep 8, 2026
Fix is on staging, will be done soon
[-]Each US distance rate appears twice after copying distance rates from USD workspace[/-][+][Due for payment 2026-09-16] Each US distance rate appears twice after copying distance rates from USD workspace[/+]melvin-bot commentedon Sep 9, 2026
@Krishna2323 / @thelullabyy
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.74-2 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-09-16. 🎊
The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ 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]
Krishna2323 commentedon Sep 10, 2026
@neil-marcellini, I think we can close this issue. Payments will be handled centrally for the project.
I have added this issue here: https://github.com/orgs/Expensify/projects/276/views/1