Revert "Continue to retry failed requests when offline (#8623)"#8739
Revert "Continue to retry failed requests when offline (#8623)"#8739
Conversation
This reverts commit 0caca27. This PR is faulty, because although it does restore retries for failed requests, it also causes `onDegraded` and `onBreak` to be fired for `RpcServiceChain`, and hence causes `NetworkController:rpcEndpointChainDegraded` and `NetworkController:rpcEndpointChainUnavailable` to be fired as well.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 263e1ca. Configure here.
| // This prevents degraded/break callbacks from being triggered | ||
| if (isOffline()) { | ||
| return false; | ||
| } |
There was a problem hiding this comment.
Circuit breaker still fires onBreak when offline
Medium Severity
The comment on line 366 claims skipping retries when offline "prevents degraded/break callbacks from being triggered," but this is only partially true. The retryFilterPolicy returning false prevents onDegraded (since onGiveUp won't fire), but the circuit breaker is a separate inner policy that still counts each individual request failure via handleWhen(isServiceFailure). After DEFAULT_MAX_CONSECUTIVE_FAILURES (15) separate failed requests while offline, the circuit will break and onBreak will fire — and the !this.#isOffline() guard that previously suppressed this callback was removed. With block tracker polling roughly every 20 seconds, this threshold is reachable after ~5 minutes offline, potentially causing the same NetworkController:rpcEndpointUnavailable events the PR aims to prevent.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 263e1ca. Configure here.
There was a problem hiding this comment.
Okay, we definitely need to investigate this, but this comment was present before the commit we are reverting.


Explanation
This reverts commit 0caca27.
This PR is faulty, because although it does restore retries for failed requests, it also causes
onDegradedandonBreakto be fired forRpcServiceChain, and hence causesNetworkController:rpcEndpointChainDegradedandNetworkController:rpcEndpointChainUnavailableto be fired as well.References
Checklist
Note
Medium Risk
Changes
RpcServiceretry/circuit-breaker behavior based on offline status, which can affect request reliability and when network degraded/unavailable events fire. Risk is mitigated by expanded unit/integration tests for offline scenarios.Overview
Reverts the previous behavior that continued retrying RPC requests while the user is offline by making
RpcService's retry filter short-circuit whenisOffline()is true.This prevents offline connection failures from triggering retries, circuit breaks, and downstream NetworkController retry/degraded/unavailable event emissions, with updated/added tests covering offline unavailable and degraded scenarios and updated ESLint suppression metadata.
Reviewed by Cursor Bugbot for commit 263e1ca. Bugbot is set up for automated code reviews on this repo. Configure here.