Skip to content

Distance rates-New rates appear and toggle is on after disabling simulate failing #99268

Closed

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


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.

  1. Navigate to https://staging.new.expensify.com/
  2. Go to workspace settings > Distance rates
  3. Press Ctrl + D
  4. Turn the "Simulate failing network requests" toggle on
  5. Click on Settings
  6. Turn the "Auto-update government rate" toggle on
  7. Dismiss the error with the X
  8. Press Ctrl + D
  9. Turn the "Simulate failing network requests" toggle off
  10. Go to another tab in the workspace settings, and go back to Distance rates

Expected Result:

There are no new rates in the Distance rates list, and the "Auto-update government rate" toggle is still disabled.

Actual Result:

New rates appear in the Distance rates list, and the "Auto-update government rate" toggle is enabled.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome Safari

Screenshots/Videos

Bug7240216_1787421348093.Failure_path_issue.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Rizky Gunawan
Bug ID: 7240216

Issue OwnerCurrent Issue Owner: @neil-marcellini

Activity

  1. applause-bot commented on Aug 23, 2026

    @applause-bot
    Author

    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

  2. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Aug 23, 2026
  3. melvin-bot commented on Aug 23, 2026

    @melvin-bot

    @neil-marcellini recently merged #97936, but they are OOO right now, so I'll auto-assign someone else.

  4. melvin-bot commented on Aug 23, 2026

    @melvin-bot

    Triggered auto assignment to @danieldoglas (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  5. github-actions commented on Aug 23, 2026

    @github-actions
    Contributor

    👋 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:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  6. melvin-bot commented on Aug 23, 2026

    @melvin-bot

    @neil-marcellini @thelullabyy you have been assigned to this deploy blocker because you reviewed the offending PR: #97936

  7. melvin-bot commented on Aug 23, 2026

    @melvin-bot

    @Krishna2323 you have been assigned to this deploy blocker because you authored the offending PR: #97936

  8. melvin-bot commented on Aug 23, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  9. MelvinBot commented on Aug 23, 2026

    @MelvinBot
    Contributor

    Issue Analysis

    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:

    1. "Simulate failing network requests" maps to shouldFailAllRequests (TestToolMenu.tsx:165).
    2. 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."
    3. 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.
    4. 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

    The action fully rolls back on failure:

    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.


    view run

  10. added and removed
    DeployBlockerCashThis issue or pull request should block deployment
    on Aug 24, 2026
  11. mountiny commented on Aug 24, 2026

    @mountiny
    Contributor

    Demoting, I dont think this has to be a blocker

  12. Krishna2323 commented on Aug 24, 2026

    @Krishna2323
    Contributor

    Checking...

  13. Krishna2323 commented on Aug 24, 2026

    @Krishna2323
    Contributor

    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.

    Monosnap.screencast.2026-08-24.18-33-51.mp4
  14. neil-marcellini commented on Aug 24, 2026

    @neil-marcellini
    Contributor

    Sounds like there's nothing to fix here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2Engineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions