Merged
Conversation
b720757 to
18c2bad
Compare
723d0a5 to
fc90b6f
Compare
jiexi
reviewed
Feb 22, 2024
fc90b6f to
a485424
Compare
Co-authored-by: jiexi <jiexiluan@gmail.com>
BelfordZ
previously approved these changes
Feb 22, 2024
mcmire
previously approved these changes
Feb 22, 2024
Contributor
mcmire
left a comment
There was a problem hiding this comment.
One nit but looks good either way! Great changelog entries.
jiexi
reviewed
Feb 22, 2024
Member
jiexi
left a comment
There was a problem hiding this comment.
QueuedRequestController also needs to be bumped a major
|
|
||
| - **BREAKING:** `setNetworkClientIdForDomain` now throws an error if passed `metamask` for the domain param ([#3908](https://github.com/MetaMask/core/pull/3908)). | ||
| - **BREAKING:** `setNetworkClientIdForDomain` now includes a check that the requesting `domain` has already been granted permissions in the `PermissionsController` before adding it to `domains` state and throws an error if the domain does not have permissions ([#3908](https://github.com/MetaMask/core/pull/3908)). | ||
| - **BREAKING:** the `domains` state now no longer contains a `metamask` domain key Consumers should instead use the `selectedNetworkClientId` from the `NetworkController` to get the selected network for the `metamask` domain ([#3908](https://github.com/MetaMask/core/pull/3908)). |
Member
There was a problem hiding this comment.
This in implementation detail heavy. To the end user, getNetworkClientIdForDomain will still passthrough the selectedNetworkClientId, so nothing should be different for the consumer? Do we have consumers accessing SelectedNetworkController state directly?
Co-authored-by: jiexi <jiexiluan@gmail.com>
Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>
jiexi
approved these changes
Feb 22, 2024
3 tasks
mcmire
added a commit
that referenced
this pull request
Mar 6, 2024
`@metamask/queued-request-controller` was bumped to 0.5.0 in [release 118.0](#3958), but changes that took place since 0.4.0 were not included in the changelog for that release. This commit corrects this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@metamask/selected-network-controller
[8.0.0]
Changed
setNetworkClientIdForDomainnow throws an error if passedmetamaskas its first (domain) argument (#3908).setNetworkClientIdForDomainnow includes a check that the requestingdomainhas already been granted permissions in thePermissionsControllerbefore adding it todomainsstate and throws an error if the domain does not have permissions (#3908).domainsstate now no longer contains ametamaskdomain key Consumers should instead use theselectedNetworkClientIdfrom theNetworkControllerto get the selected network for themetamaskdomain (#3908).getProviderAndBlockTrackernow throws an error if called with any domain while theperDomainNetworkflag is false. Consumers should instead use theproviderandblockTrackerfrom theNetworkControllerwhen theperDomainNetworkflag is false (#3908).getProviderAndBlockTrackernow throws an error if called with a domain that is not in domains state (#3908).getNetworkClientIdForDomainnow returns theselectedNetworkClientIdfor the globally selected network if theperDomainNetworkflag is false and if the domain is not in thedomainsstate (#3908).Removed
selectedNetworkMiddlewareto set a defaultnetworkClientIdfor the requesting origin when not already set. Now if nonetworkClientIdis already set for the requesting origin, the middleware will not add the origin todomainsstate but will add thenetworkClientIdcurrently set for theselectedNetworkClientfrom theNetworkControllerto the request object (#3908).Fixed
SelectedNetworkControllernow listens fornetworkConfigurationremoval events on theNetworkControllerand if a removednetworkClientIdmatches the setnetworkClientIdfor any domains in its state, it updates them to the globally selectednetworkClientIdand repoints the proxies accordingly.(#3926)