You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: migrate GatorPermissionsController to @metamask/messenger (#6461)
## Explanation
<!--
Thanks for your contribution! Take a moment to answer these questions so
that reviewers have the information they need to properly understand
your changes:
* What is the current state of things and why does it need to change?
* What is the solution your changes offer and how does it work?
* Are there any changes whose purpose might not obvious to those
unfamiliar with the domain?
* If your primary goal was to update one package but you found you had
to update another one along the way, why did you do so?
* If you had to upgrade a dependency, why did you do so?
-->
This PR migrates `GatorPermissionsController` to the new
`@metamask/messenger` message bus, as opposed to the one exported from
`@metamask/base-controller`.
## References
<!--
Are there any issues that this pull request is tied to?
Are there other links that reviewers should consult to understand these
changes better?
Are there client or consumer pull requests to adopt any breaking
changes?
For example:
* Fixes #12345
* Related to #67890
-->
* Related to #5626
## Checklist
- [ ] I've updated the test suite for new or updated code as appropriate
- [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [ ] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs),
highlighting breaking changes as necessary
- [ ] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changes
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Migrates `GatorPermissionsController` to `@metamask/messenger`,
updates Base Controller imports/metadata, refactors tests, and wires
package/graph updates.
>
> - **Breaking changes**:
> - Move from `RestrictedMessenger` (via `@metamask/base-controller`) to
`Messenger` from `@metamask/messenger` in `GatorPermissionsController`
and tests.
> - Rename state metadata key `anonymous` to `includeInDebugSnapshot`;
switch imports to `@metamask/base-controller/next`.
> - **Controller**
(`packages/gator-permissions-controller/src/GatorPermissionsController.ts`):
> - Replace `messagingSystem` usages with `messenger`
(`registerActionHandler`, `call`).
> - Update `GatorPermissionsControllerMessenger` type to use
`Messenger`.
> - Preserve state shape; keep getters/actions; no behavior change
beyond messenger plumbing.
> - **Tests**
(`packages/gator-permissions-controller/src/GatorPermissionsController.test.ts`):
> - Refactor to new `Messenger` types/utilities; introduce
root/delegated messenger setup; update metadata tests to
`includeInDebugSnapshot`.
> - **Package config**:
> - Add dependency `@metamask/messenger` and TypeScript project
references to `packages/messenger`.
> - **Docs/graph**:
> - Update README dependency graph to show `base_controller -->
messenger` and `gator_permissions_controller --> messenger`; add
`eip_7702_internal_rpc_middleware` edge.
> - **Changelog**:
> - Note breaking migration to `@metamask/messenger` and metadata rename
under Unreleased.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
15b0e0c. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
0 commit comments