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

TransactionController is listening for network ID to change despite taking onNetworkStateChange option #18291

Closed
mcmire opened this issue Mar 22, 2023 · 2 comments

Comments

@mcmire
Copy link
Contributor

mcmire commented Mar 22, 2023

The name of the onNetworkStateChange option along with the way that it's used doesn't match what method is being used to listen to the network. Currently we configure TransactionController to listen for the network ID to change, and when this happens, it will refresh its state based on the current network. However, this is the only controller for which we use network ID to know when the network has changed; usually we either use the networkDidChange event or we listen for the whole NetworkController state to change. We should pick one of these that is more appropriate. We should probably also onNetworkStateChange if we are not going to listen for the whole NetworkController state to change.

@github-actions github-actions bot added the stale issues and PRs marked as stale label Jul 20, 2023
@pedronfigueiredo pedronfigueiredo removed the stale issues and PRs marked as stale label Jul 20, 2023
@MetaMask MetaMask deleted a comment from github-actions bot Jul 20, 2023
@MajorLift
Copy link
Contributor

MajorLift commented Feb 16, 2024

@jiexi @shanejonas @mcmire Does MetaMask/core#3643 partially or fully resolve this issue, now that TransactionController listens to NetworkController:stateChange via the messaging system?

@mcmire
Copy link
Contributor Author

mcmire commented Oct 25, 2024

Yes, I think we can close this issue now.

@mcmire mcmire closed this as completed Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants