Skip to content

fix: ignore legacy publicConfig stream in createExternalExtensionProvider - #429

Open
ZayanKhan-12 wants to merge 2 commits into
MetaMask:mainfrom
ZayanKhan-12:fix/294-ignore-publicconfig-stream
Open

fix: ignore legacy publicConfig stream in createExternalExtensionProvider#429
ZayanKhan-12 wants to merge 2 commits into
MetaMask:mainfrom
ZayanKhan-12:fix/294-ignore-publicconfig-stream

Conversation

@ZayanKhan-12

@ZayanKhan-12 ZayanKhan-12 commented Aug 4, 2026

Copy link
Copy Markdown

Description

When connecting to MetaMask via createExternalExtensionProvider(), the wallet still writes state updates to the legacy publicConfig substream of the multiplexed port connection. The provider side never registers a substream for that name, so ObjectMultiplex logs an ObjectMultiplex - orphaned data for stream "publicConfig" warning to the consuming extension's console for every message.

The MetaMask extension's own contentscript already solves this for the injected in-page provider by calling ignoreStream(LEGACY_PUBLIC_CONFIG) on its multiplexer (contentscript source), which is why web pages don't see these warnings. This PR applies the same pattern to the external extension provider path: the ObjectMultiplex instance created in createExternalExtensionProvider now registers publicConfig as an ignored substream (mux.ignoreStream('publicConfig')) before the pipeline is wired up, so legacy messages are silently dropped instead of warned about.

Fixes #294

Testing

  • Added a unit test in src/extension-provider/createExternalExtensionProvider.test.ts that sends a message on the publicConfig substream via the existing MockPort helper and asserts no orphaned-data warning is logged. Verified the test fails without the fix and passes with it.
  • yarn test: 8 suites / 131 tests passed.
  • yarn lint (eslint, constraints, prettier, depcheck/dedupe, changelog validate): clean.
  • yarn build: verified dist/extension-provider/createExternalExtensionProvider.{mjs,cjs} contain the ignoreStream call.

🤖 Generated with Claude Code


Note

Low Risk
Narrow change to stream multiplex handling for a legacy substream; no RPC or auth behavior changes.

Overview
Third-party extensions using createExternalExtensionProvider no longer get ObjectMultiplex - orphaned data for stream "publicConfig" warnings when MetaMask still pushes updates on the legacy publicConfig substream.

The multiplexer now calls ignoreStream('publicConfig') before the port pipeline is wired (same idea as the MetaMask contentscript). A unit test asserts that a publicConfig notification does not trigger that warning. CHANGELOG documents the fix under [Unreleased].

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

…ider

The MetaMask extension still writes state updates to the legacy
`publicConfig` substream of its multiplexed connection. The provider
created by `createExternalExtensionProvider` never registers a substream
for it, so every message triggers an
'ObjectMultiplex - orphaned data for stream "publicConfig"' warning in
the consuming extension's console.

The MetaMask extension's own contentscript already handles this by
calling `ignoreStream` on its multiplexer for the legacy stream name, so
pages using the injected provider never see the warning. Apply the same
pattern to the external extension provider path: register the
`publicConfig` substream as ignored on the `ObjectMultiplex` instance
before wiring up the pipeline.

Fixes MetaMask#294

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ZayanKhan-12
ZayanKhan-12 requested a review from a team as a code owner August 4, 2026 00:32
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

Provider emits warning: ObjectMultiplex - orphaned data for stream "publicConfig"

1 participant