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
Distance rates-New rates appear and toggle is on after disabling simulate failing #99268
Version Number: v9.4.59-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:#97936 Email or phone of affected tester (no customers):applausetester+ag220826@applause.expensifail.com Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: Windows 11/ Chrome, Samsung S23FE/ Android 16, iPhone 13 Mini/ iOS 26.5 App Component: Workspace Settings
Action Performed:
Preconditions: Use an Expensifail account.
Have a Control workspace where you're an admin, with Distance rates enabled.
Workspace currency is set to USD.
👋 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.
This looks like a "Simulate failing network requests" test-tool artifact, not a rollback bug — recommend demoting rather than reverting. The failureData rollback in PR #97936 is present and correct; the rates/toggle reappear because the test tool lets the request succeed on the server while dropping the response on the client.
Offending PR:#97936 (the "Auto-update government rate" feature) is confirmed as the source of this code — it's the only PR touching this feature and introduces setWorkspaceDistanceAutoUpdate and the SET_WORKSPACE_DISTANCE_AUTO_UPDATE command. But the observed behavior is expected given how the test tool works.
Why the rates/toggle come back:
"Simulate failing network requests" maps to shouldFailAllRequests (TestToolMenu.tsx:165).
That tool lets the request reach the server and succeed, then drops the response client-side — documented at HttpUtils.ts:137: "Test mode where all requests will succeed in the server, but fail to return a response."
On the thrown error the client applies failureData and drops the request (SequentialQueue.ts:354), so the toggle/rates roll back locally and the tester sees the error X.
But the server already persisted the change. Re-opening Distance rates refetches real server state via openPolicyDistanceRatesPage on mount/reconnect (PolicyDistanceRatesSettingsPage.tsx:90), so the genuinely-saved rates/toggle reappear. This is the same behavior every optimistic write exhibits with this tool.
Investigation details — the failureData is correct
failureData (DistanceRate.ts:745) resets the toggle (shouldAutoUpdateGovernmentDistanceRates → null when enabling) and removes each optimistically-added rate via failureRates ({rateID: null}).
The action also passes optimisticRateIDs to the server (DistanceRate.ts:768) so the server reuses client-generated IDs — no duplicate rates on refetch. Deliberate, idempotent design.
Under a real failure (server returns an error jsonCode, or true offline via shouldForceOffline), failureData rolls the toggle and rates back and the refetch shows nothing added — no bug. The "reappearance" is specific to the shouldFailAllRequests tool semantics (server succeeds, response dropped), not to this PR.
This is also N/A in production (new feature), so it doesn't affect existing users.
Recommended resolution: Demote from DeployBlockerCash — do not revert. To close the loop, re-test with "Force offline" (shouldForceOffline) instead of "Simulate failing network requests" to exercise the genuine rollback path; that path leaves no new rates and a disabled toggle. If it fails offline too, reopen with that evidence.
Test-tool artifact, not a bug. “Simulate failing network requests” still sends the request to the server, then throws FAILED_TO_FETCH after the response. So the change in server is persisted and gets returned once the page is opened again.
Activity
applause-bot commentedon Aug 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/629197a00e0f80dd7687c9ac1ef325a389910e606fce02c1eebee44d01d569be
melvin-bot commentedon Aug 23, 2026
@neil-marcellini recently merged #97936, but they are OOO right now, so I'll auto-assign someone else.
melvin-bot commentedon Aug 23, 2026
Triggered auto assignment to @danieldoglas (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.github-actions commentedon Aug 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:
melvin-bot commentedon Aug 23, 2026
@neil-marcellini @thelullabyy you have been assigned to this deploy blocker because you reviewed the offending PR: #97936
melvin-bot commentedon Aug 23, 2026
@Krishna2323 you have been assigned to this deploy blocker because you authored the offending PR: #97936
melvin-bot commentedon Aug 23, 2026
💬 A slack conversation has been started in #expensify-open-source
MelvinBot commentedon Aug 23, 2026
Issue Analysis
This looks like a "Simulate failing network requests" test-tool artifact, not a rollback bug — recommend demoting rather than reverting. The
failureDatarollback in PR #97936 is present and correct; the rates/toggle reappear because the test tool lets the request succeed on the server while dropping the response on the client.Offending PR: #97936 (the "Auto-update government rate" feature) is confirmed as the source of this code — it's the only PR touching this feature and introduces
setWorkspaceDistanceAutoUpdateand theSET_WORKSPACE_DISTANCE_AUTO_UPDATEcommand. But the observed behavior is expected given how the test tool works.Why the rates/toggle come back:
shouldFailAllRequests(TestToolMenu.tsx:165).HttpUtils.ts:137: "Test mode where all requests will succeed in the server, but fail to return a response."failureDataand drops the request (SequentialQueue.ts:354), so the toggle/rates roll back locally and the tester sees the error X.openPolicyDistanceRatesPageon mount/reconnect (PolicyDistanceRatesSettingsPage.tsx:90), so the genuinely-saved rates/toggle reappear. This is the same behavior every optimistic write exhibits with this tool.Investigation details — the failureData is correct
The action fully rolls back on failure:
setWorkspaceDistanceAutoUpdate— DistanceRate.ts:644failureData(DistanceRate.ts:745) resets the toggle (shouldAutoUpdateGovernmentDistanceRates→nullwhen enabling) and removes each optimistically-added rate viafailureRates({rateID: null}).optimisticRateIDsto the server (DistanceRate.ts:768) so the server reuses client-generated IDs — no duplicate rates on refetch. Deliberate, idempotent design.Under a real failure (server returns an error
jsonCode, or true offline viashouldForceOffline),failureDatarolls the toggle and rates back and the refetch shows nothing added — no bug. The "reappearance" is specific to theshouldFailAllRequeststool semantics (server succeeds, response dropped), not to this PR.This is also N/A in production (new feature), so it doesn't affect existing users.
Recommended resolution: Demote from
DeployBlockerCash— do not revert. To close the loop, re-test with "Force offline" (shouldForceOffline) instead of "Simulate failing network requests" to exercise the genuine rollback path; that path leaves no new rates and a disabled toggle. If it fails offline too, reopen with that evidence.view run
mountiny commentedon Aug 24, 2026
Demoting, I dont think this has to be a blocker
Krishna2323 commentedon Aug 24, 2026
Checking...
Krishna2323 commentedon Aug 24, 2026
Test-tool artifact, not a bug. “Simulate failing network requests” still sends the request to the server, then throws
FAILED_TO_FETCHafter the response. So the change in server is persisted and gets returned once the page is opened again.Monosnap.screencast.2026-08-24.18-33-51.mp4
neil-marcellini commentedon Aug 24, 2026
Sounds like there's nothing to fix here.