-
-
Notifications
You must be signed in to change notification settings - Fork 267
feat(network-controller): connect NetworkController to ConnectivityController
#7627
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature/add-connectivity-controller
Are you sure you want to change the base?
feat(network-controller): connect NetworkController to ConnectivityController
#7627
Conversation
|
@metamaskbot publish-preview |
1a810fe to
b590b43
Compare
NetworkController to ConnectivityController
b590b43 to
1bdba27
Compare
| throw new Error('Could not make request to endpoint.'); | ||
| } | ||
|
|
||
| const connectivityState = messenger.call( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's fine to add this check just to be absolutely sure that these events aren't published. But I wonder if we should add similar logic to RpcService as well? If the user is offline, and a "connection error" is thrown while making a request, then the request should not be retried. If we do this, then the onDegraded or onBreak callbacks within RpcService should never be called, and therefore neither NetworkController:rpcEndpointDegraded nor NetworkController:rpcEndpointUnavailable should be published.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1bdba27 to
753eb65
Compare
5c3f070 to
35be87b
Compare
|
@metamaskbot publish-preview |
3d671df to
be34729
Compare
|
@metamaskbot publish-preview |
…ntroller - Add ConnectivityController:getState action handler requirement - Suppress rpcEndpointUnavailable and rpcEndpointDegraded events when offline - Update NetworkController to check connectivity status before publishing events - Add tests for offline event suppression
…fline - Add isOffline check to RpcService retry filter policy to prevent retries when offline - Suppress rpcEndpointUnavailable and rpcEndpointDegraded events when offline - Add tests to verify retries don't happen when offline - Add tests to verify events are suppressed when offline - Update CHANGELOG with breaking change documentation
e3d5f1f to
d59bf85
Compare
Explanation
Connects
NetworkControllertoConnectivityControllerto suppress RPC endpoint error events when the user is offline.Changes
NetworkController:rpcEndpointUnavailableandNetworkController:rpcEndpointDegradedevents when connectivity status is offlineBreaking Changes
NetworkControllernow requiresConnectivityController:getStateaction handler to be registered on the messengerconnectivityStatusproperty ('online'or'offline')NetworkControllerMessengerReferences
Checklist
Note
Makes RPC behavior offline-aware and updates dependencies/types.
@metamask/connectivity-controller; update messenger to allowConnectivityController:getStateisOfflineinto RPC services; inRpcService, skip retries and circuit-breaker triggers when offlineNetworkController:rpcEndpointUnavailableandNetworkController:rpcEndpointDegradedevents when offlineConnectivityController:getStateREADMEdependency graph,tsconfigreferences,package.json, andyarn.lockConnectivityController:getStateinCHANGELOGWritten by Cursor Bugbot for commit d59bf85. This will update automatically on new commits. Configure here.