-
-
Notifications
You must be signed in to change notification settings - Fork 256
Open
Description
Problem
With the new changes to both clients, we now refresh the status of the network whenever the user loads the client for the first time or switches networks. However, if they do not switch networks, it is still possible for a user to see a banner indicating that a network is degraded or unavailable when it is not the case.
Clients should have an always-up-to-date status of all enabled networks. To enable this we need to make some changes to NetworkController.
Acceptance Criteria
networksMetadata.statuswithin NetworkController state should always reflect the current status of the network and be updated as requests are made through the network.networksMetadata.statusshould begin atunknown, then progress to eitheravailable,unavailable,blocked, ordegraded.- The status should be
blockedwhen the last request responds with an error that indicates that Infura is blocking the user. - The status should be
degradedwhen the last request responds in more than 5 seconds, or responds with an error such that the retry policy gives up. - The status should be
unavailablewhen the last request breaks the circuit.
- The status should be
- When the network is switched,
networksMetadata.statusshould revert tounknowninitially. - If the status is changed to
unavailable,degraded, orblocked, then we should include details undernetworksMetadata.statusDetails(otherwise it should be cleared).- If we have an error, then some part of it should be serialized in state under
networksMetadata.statusDetails.error.- If the error is an RPC error we should capture the
code. If not an internal error, we should capture themessage. - If the error is not an RPC error we should reframe it as one, and follow the previous rule.
- If the error is an RPC error we should capture the
- If the status is
degradedand we do not have an error but the last request was merely slow, then we should captureisSlow: true.
- If we have an error, then some part of it should be serialized in state under
networksMetadata.statusDetailsshould be reset per request.networksMetadata.latencyshould capture the latencies of the last 5 requests (so that they can be averaged).
Metadata
Metadata
Assignees
Labels
No labels