Skip to content

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

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

feat(wallet)!: wire LoggingController into default initialization#9378
grypez wants to merge 2 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
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/wallet initialization now constructs LoggingController and registers it on the shared messenger (LoggingController:getState, :stateChange, :add, :clear), matching extension/mobile wiring with only messenger and state—no new instanceOptions slot.

Adds the @metamask/logging-controller dependency, a logging-controller initialization instance (exported via instances/index so it joins defaultConfigurations), unit tests for that config, and Wallet integration 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.

@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
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