Skip to content

Gracefully handle invalid selectedNetworkClientId upon NetworkController initialization #5739

Open
@mcmire

Description

@mcmire

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions