Skip to content

refactor!: Standardise SnapsRegistry action names and types#3918

Merged
Mrtenz merged 11 commits intocontroller-refactorsfrom
mrtenz/registry-refactor
Mar 25, 2026
Merged

refactor!: Standardise SnapsRegistry action names and types#3918
Mrtenz merged 11 commits intocontroller-refactorsfrom
mrtenz/registry-refactor

Conversation

@Mrtenz
Copy link
Member

@Mrtenz Mrtenz commented Mar 24, 2026

This renames the JsonSnapsRegistry class to SnapsRegistryController and 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/SnapsRegistry to SnapRegistryController, moves registry types into registry/types.ts, and switches messenger wiring to registerMethodActionHandlers with new method-based action types (including requestUpdate replacing update).

Updates SnapController, tests, and test utilities/mocks to use the new SnapRegistryController:* action/event names and SnapRegistryStatus enum, and refreshes the changelog to document the rename.

Written by Cursor Bugbot for commit 7a64b38. This will update automatically on new commits. Configure here.

@Mrtenz Mrtenz force-pushed the mrtenz/registry-refactor branch from 3d7d941 to 6fd489b Compare March 25, 2026 09:25
@Mrtenz Mrtenz marked this pull request as ready for review March 25, 2026 09:32
@Mrtenz Mrtenz requested a review from a team as a code owner March 25, 2026 09:32
@codecov
Copy link

codecov bot commented Mar 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (controller-refactors@75f65f4). Learn more about missing BASE report.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Mrtenz Mrtenz requested a review from FrederikBolding March 25, 2026 10:20
};

const controllerName = 'SnapsRegistry';
const controllerName = 'SnapsRegistryController';
Copy link
Member

Choose a reason for hiding this comment

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

Since we are altering this, should it be SnapsRegistryController or SnapRegistryController

Copy link
Member Author

Choose a reason for hiding this comment

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

The repo is called snaps-registry. 🤷

@Mrtenz Mrtenz requested a review from FrederikBolding March 25, 2026 11:40
Comment on lines +2 to +3
SnapRegistryControllerActions,
SnapRegistryControllerEvents,
Copy link
Member

Choose a reason for hiding this comment

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

Aren't we discouraging exporting full set of actions and events?

Copy link
Member Author

Choose a reason for hiding this comment

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

We're exporting them in controllers in MetaMask/core, so I'm not sure.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm. I thought thats what @mcmire recommended to me on my recent PR. But I can't find the reference for it 🤔

Copy link
Member

Choose a reason for hiding this comment

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

Let's at least make sure we figure that out before merging all of these changes

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

@Mrtenz Mrtenz merged commit 89b1675 into controller-refactors Mar 25, 2026
127 checks passed
@Mrtenz Mrtenz deleted the mrtenz/registry-refactor branch March 25, 2026 12:13
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.

2 participants