Skip to content
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

[network-controller] Prevent inconsistent state during switch #4126

Open
Gudahtt opened this issue Mar 28, 2024 · 0 comments
Open

[network-controller] Prevent inconsistent state during switch #4126

Gudahtt opened this issue Mar 28, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Gudahtt
Copy link
Member

Gudahtt commented Mar 28, 2024

When the NetworkController switches networks, the state changes 3 times: once to update providerConfig, once to update the network metadata (e.g. the network status), and once to update the selectedClientId. In between these changes, the NetworkController state will be inconsistent (providerConfig will not match the selectedClientId, and the network status will be stale). These state changes are all synchronous, they don't depend on any network requests (the lookup step comes later).

We should update the NetworkController to make a single state change, rather than three. This would prevent the state from being inconsistent.

@Gudahtt Gudahtt added the bug Something isn't working label Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant