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

[selected-network-controller] Track metamask selected domain #5107

Open
Gudahtt opened this issue Jan 7, 2025 · 2 comments
Open

[selected-network-controller] Track metamask selected domain #5107

Gudahtt opened this issue Jan 7, 2025 · 2 comments
Assignees
Labels

Comments

@Gudahtt
Copy link
Member

Gudahtt commented Jan 7, 2025

The SelectedNetworkController doesn't track the selected chain for the metamask domain, instead it relies on the NetworkController for this. As we make progress with eliminating reliance upon the "globally selected network", we want to move the metamask domain "current chain" tracking to the SelectedNetworkController so that all "selected chains" are tracked in the same place.

Additional details from @adonesky1 :

Migrate the (global) selectedNetworkClientid from the NetworkController to state in the domains object in the SelectedNetworkController.

  • This will require updating selectors to point to this new location for this state.
  • This will also require updating listeners.
@Gudahtt Gudahtt added bug Something isn't working team-wallet-api-platform labels Jan 7, 2025
@adonesky1
Copy link
Contributor

adonesky1 commented Jan 9, 2025

This was by design at first since we weren't ready to migrate that state. But we should still do it now. I don't see any reason for it to remain blocked:

Migrate the (global) selectedNetworkClientid from the NetworkController to state in the domains object in the SelectedNetworkController.

  • This will require updating selectors to point to this new location for this state.
  • This will also require updating listeners.

@Gudahtt
Copy link
Member Author

Gudahtt commented Jan 9, 2025

This was by design at first since we weren't ready to migrate that state

Ah, sorry I misunderstood how this worked. I thought it was set post-initialization, but it's currently never set, so this isn't really a bug. I'll update the description to reflect the work you mentioned.

@Gudahtt Gudahtt changed the title [selected-network-controller] Invalid initial state for metamask domain [selected-network-controller] Track metamask selected domain Jan 9, 2025
@Gudahtt Gudahtt added enhancement New feature or request and removed bug Something isn't working labels Jan 9, 2025
@jiexi jiexi self-assigned this Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants