Skip to content

feat(wallet)!: wire LoggingController into default initialization#9378

Open
grypez wants to merge 3 commits into
mainfrom
grypez/wire-logging-controller
Open

feat(wallet)!: wire LoggingController into default initialization#9378
grypez wants to merge 3 commits into
mainfrom
grypez/wire-logging-controller

Conversation

@grypez

@grypez grypez commented Jul 2, 2026

Copy link
Copy Markdown
Member

Explanation

Wire LoggingController into the default @metamask/wallet initialization so
that its actions and events are exposed on the shared messenger bus:
LoggingController:getState/:stateChange, LoggingController:add, and
LoggingController:clear.

@metamask/wallet is the shared controller-integration layer adopted by
extension, mobile, and other clients, so any constructor value that differs
between clients must be an injectable instanceOptions rather than hardcoded.
For LoggingController there is nothing to inject: both clients construct it
with only messenger and state, and it delegates no external actions/events.
It therefore wires up as a plain namespaced child messenger with no
instanceOptions slot.

Per-environment options

Option Extension Mobile Default
(none) Constructs with { messenger, state } only Constructs with { messenger, state } only Same

There are no injectable options. The extension additionally registers a
runtime.onInstalled listener that emits a version-update log; that is
client-side glue around construction (not a controller constructor option) and
stays in the extension's own adoption layer.

References

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, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes (N/A — no client currently constructs LoggingController through @metamask/wallet yet; adoption PRs follow separately)

Note

Medium Risk
Marked breaking for @metamask/wallet consumers because default initialization and wallet state shape gain LoggingController; scope is limited to standard controller wiring with tests and no injectable options.

Overview
Breaking: @metamask/wallet now initializes LoggingController by default alongside the other bundled controllers, exposing LoggingController:getState, :stateChange, :add, and :clear on the wallet messenger.

The wiring follows the same pattern as controllers like AddressBookController: a new logging-controller initialization instance constructs the controller from messenger and state only, with no instanceOptions slot. @metamask/logging-controller is added as a direct dependency; TypeScript project references, README dependency graph, and CODEOWNERS for the init path are updated accordingly.

Integration is covered by unit tests on the init module and new Wallet tests for default state, constructor state.LoggingController, and routing LoggingController:add through the wallet messenger.

Reviewed by Cursor Bugbot for commit bc4dab4. Bugbot is set up for automated code reviews on this repo. Configure here.

@grypez grypez force-pushed the grypez/wire-logging-controller branch from 259c830 to d3d3caf Compare July 2, 2026 16:51
grypez and others added 2 commits July 2, 2026 13:05
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>
@grypez grypez force-pushed the grypez/wire-logging-controller branch from d3d3caf to 58e804b Compare July 2, 2026 17:17
@grypez grypez marked this pull request as ready for review July 2, 2026 17:31
@grypez grypez requested a review from a team as a code owner July 2, 2026 17:31
@grypez grypez temporarily deployed to default-branch July 2, 2026 17:31 — with GitHub Actions Inactive
…ontroller

# Conflicts:
#	packages/wallet/CHANGELOG.md
#	packages/wallet/package.json
#	yarn.lock
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.

1 participant