NetworkController should prevent selectedNetworkClientId from being invalid whenever state is updated. In fact, it goes one step further: upon initialization, it will immediately throw an error if selectedNetworkClientId is invalid.
Regrettably, this does not lead to a great user experience. If this occurs, we should instead reset selectedNetworkClientId to a reasonable default chain (Mainnet would work, but we would have to account for if Mainnet is not present). We should also report this fact to Sentry.
This solution was mentioned in the discussion for incident 1051.
Acceptance Criteria
- Upon initialization, if it detects that
selectedNetworkClientId does not refer to an RPC endpoint, NetworkController resets the property to a reasonable default chain and reports the problem to Sentry.
NetworkController should prevent
selectedNetworkClientIdfrom being invalid whenever state is updated. In fact, it goes one step further: upon initialization, it will immediately throw an error ifselectedNetworkClientIdis invalid.Regrettably, this does not lead to a great user experience. If this occurs, we should instead reset
selectedNetworkClientIdto a reasonable default chain (Mainnet would work, but we would have to account for if Mainnet is not present). We should also report this fact to Sentry.This solution was mentioned in the discussion for incident 1051.
Acceptance Criteria
selectedNetworkClientIddoes not refer to an RPC endpoint, NetworkController resets the property to a reasonable default chain and reports the problem to Sentry.