refactor!: Standardise SnapsRegistry action names and types#3918
refactor!: Standardise SnapsRegistry action names and types#3918Mrtenz merged 11 commits intocontroller-refactorsfrom
SnapsRegistry action names and types#3918Conversation
3d7d941 to
6fd489b
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## controller-refactors #3918 +/- ##
=======================================================
Coverage ? 98.56%
=======================================================
Files ? 425
Lines ? 12313
Branches ? 1934
=======================================================
Hits ? 12136
Misses ? 177
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
packages/snaps-controllers/src/snaps/registry/SnapsRegistryController.ts
Outdated
Show resolved
Hide resolved
packages/snaps-controllers/src/snaps/registry/SnapsRegistryController.ts
Outdated
Show resolved
Hide resolved
| }; | ||
|
|
||
| const controllerName = 'SnapsRegistry'; | ||
| const controllerName = 'SnapsRegistryController'; |
There was a problem hiding this comment.
Since we are altering this, should it be SnapsRegistryController or SnapRegistryController
There was a problem hiding this comment.
The repo is called snaps-registry. 🤷
| SnapRegistryControllerActions, | ||
| SnapRegistryControllerEvents, |
There was a problem hiding this comment.
Aren't we discouraging exporting full set of actions and events?
There was a problem hiding this comment.
We're exporting them in controllers in MetaMask/core, so I'm not sure.
There was a problem hiding this comment.
Hmm. I thought thats what @mcmire recommended to me on my recent PR. But I can't find the reference for it 🤔
There was a problem hiding this comment.
Let's at least make sure we figure that out before merging all of these changes
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

This renames the
JsonSnapsRegistryclass toSnapsRegistryControllerand updates actions and events to standardise them.Note
Medium Risk
Medium risk because it is a breaking rename of registry controller class/namespace and messenger action/event names, which can silently break any callers or tests that still use the old
SnapsRegistry:*API.Overview
BREAKING refactor of the snaps registry controller API. Renames
JsonSnapsRegistry/SnapsRegistrytoSnapRegistryController, moves registry types intoregistry/types.ts, and switches messenger wiring toregisterMethodActionHandlerswith new method-based action types (includingrequestUpdatereplacingupdate).Updates
SnapController, tests, and test utilities/mocks to use the newSnapRegistryController:*action/event names andSnapRegistryStatusenum, and refreshes the changelog to document the rename.Written by Cursor Bugbot for commit 7a64b38. This will update automatically on new commits. Configure here.