feat(wallet)!: wire LoggingController into default initialization#9378
Open
grypez wants to merge 2 commits into
Open
feat(wallet)!: wire LoggingController into default initialization#9378grypez wants to merge 2 commits into
LoggingController into default initialization#9378grypez wants to merge 2 commits into
Conversation
259c830 to
d3d3caf
Compare
Wire `LoggingController` into the default wallet initialization so that `LoggingController:getState`, `LoggingController:add`, and `LoggingController:clear` are exposed on the shared messenger bus. The controller's construction is identical across extension and mobile — it takes only `messenger` and `state` and delegates no external actions/events — so no injectable `instanceOptions` are required. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
d3d3caf to
58e804b
Compare
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.
Explanation
Wire
LoggingControllerinto the default@metamask/walletinitialization sothat its actions and events are exposed on the shared messenger bus:
LoggingController:getState/:stateChange,LoggingController:add, andLoggingController:clear.@metamask/walletis the shared controller-integration layer adopted byextension, mobile, and other clients, so any constructor value that differs
between clients must be an injectable
instanceOptionsrather than hardcoded.For
LoggingControllerthere is nothing to inject: both clients construct itwith only
messengerandstate, and it delegates no external actions/events.It therefore wires up as a plain namespaced child messenger with no
instanceOptionsslot.Per-environment options
{ messenger, state }only{ messenger, state }onlyThere are no injectable options. The extension additionally registers a
runtime.onInstalledlistener that emits a version-update log; that isclient-side glue around construction (not a controller constructor option) and
stays in the extension's own adoption layer.
References
Checklist
LoggingControllerthrough@metamask/walletyet; adoption PRs follow separately)Note
Medium Risk
Breaking wallet init change can collide if clients already register LoggingController on the same messenger; behavior is otherwise a standard controller bootstrap with broad test coverage.
Overview
Breaking: Default
@metamask/walletinitialization now constructsLoggingControllerand registers it on the shared messenger (LoggingController:getState,:stateChange,:add,:clear), matching extension/mobile wiring with onlymessengerandstate—no newinstanceOptionsslot.Adds the
@metamask/logging-controllerdependency, alogging-controllerinitialization instance (exported viainstances/indexso it joinsdefaultConfigurations), unit tests for that config, andWalletintegration tests for initial state and messenger routing. Docs/chore: wallet changelog, README dependency graph edge, CODEOWNERS for the init path, and TypeScript project references.Reviewed by Cursor Bugbot for commit 58e804b. Bugbot is set up for automated code reviews on this repo. Configure here.