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

Release/118.0.0 #3958

Merged
merged 11 commits into from
Feb 22, 2024
Merged

Release/118.0.0 #3958

merged 11 commits into from
Feb 22, 2024

Conversation

adonesky1
Copy link
Contributor

@adonesky1 adonesky1 commented Feb 22, 2024

@metamask/selected-network-controller

[8.0.0]

Changed

  • BREAKING: setNetworkClientIdForDomain now throws an error if passed metamask as its first (domain) argument (#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).
  • 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).
  • BREAKING: getProviderAndBlockTracker now throws an error if called with any domain while the perDomainNetwork flag is false. Consumers should instead use the provider and blockTracker from the NetworkController when the perDomainNetwork flag is false (#3908).
  • BREAKING: getProviderAndBlockTracker now throws an error if called with a domain that is not in domains state (#3908).
  • BREAKING: getNetworkClientIdForDomain now returns the selectedNetworkClientId for the globally selected network if the perDomainNetwork flag is false and if the domain is not in the domains state (#3908).

Removed

  • BREAKING: Remove logic in selectedNetworkMiddleware to set a default networkClientId for the requesting origin when not already set. Now if no networkClientId is already set for the requesting origin, the middleware will not add the origin to domains state but will add the networkClientId currently set for the selectedNetworkClient from the NetworkController to the request object (#3908).

Fixed

  • The SelectedNetworkController now listens for networkConfiguration removal events on the NetworkController and if a removed networkClientId matches the set networkClientId for any domains in its state, it updates them to the globally selected networkClientId and repoints the proxies accordingly.
    (#3926)

@adonesky1 adonesky1 marked this pull request as ready for review February 22, 2024 16:33
@adonesky1 adonesky1 requested a review from a team as a code owner February 22, 2024 16:33
@adonesky1 adonesky1 force-pushed the release/118.0.0 branch 3 times, most recently from 723d0a5 to fc90b6f Compare February 22, 2024 16:58
Co-authored-by: jiexi <jiexiluan@gmail.com>
BelfordZ
BelfordZ previously approved these changes Feb 22, 2024
mcmire
mcmire previously approved these changes Feb 22, 2024
Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit but looks good either way! Great changelog entries.

packages/selected-network-controller/CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Contributor

@jiexi jiexi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QueuedRequestController also needs to be bumped a major

packages/selected-network-controller/CHANGELOG.md Outdated Show resolved Hide resolved

- **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)).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

packages/selected-network-controller/CHANGELOG.md Outdated Show resolved Hide resolved
packages/selected-network-controller/CHANGELOG.md Outdated Show resolved Hide resolved
packages/selected-network-controller/CHANGELOG.md Outdated Show resolved Hide resolved
packages/selected-network-controller/CHANGELOG.md Outdated Show resolved Hide resolved
@adonesky1 adonesky1 dismissed stale reviews from mcmire and BelfordZ via 331cdc3 February 22, 2024 17:31
@adonesky1 adonesky1 requested a review from mcmire February 22, 2024 17:47
@adonesky1 adonesky1 merged commit aa3a16b into main Feb 22, 2024
138 checks passed
@adonesky1 adonesky1 deleted the release/118.0.0 branch February 22, 2024 17:50
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants