You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using createExternalExtensionProvider() to create a Provider to interact with MetaMask from another browser extension. This works well, but a side-effect is that a lot of warnings are logged to the console:
ObjectMultiplex - orphaned data for stream "publicConfig"
I looked into this, and my understanding is as follows:
The communication streams between the in page/extension provider and MetaMask itself multiplex multiple named streams over a single connection using ObjectMultiplex from @metamask/object-multiplex
The warning occurs when an ObjectMultiplex stream receives a message for a named substream that has not been created, so such messages will be ignored.
The MetaMask extension itself is sending messages to the Provider I create for the publicConfig named substream
I can see such messages being received from the Port opened to communicate with MetaMask from my extension
It's not that some legacy thing in my extension is using the publicConfig stream.
Should StreamProvider ignore these messages itself, like MetaMask's contentscript does? I was tempted to open a PR to do this, but I don't have enough understanding of the legacy context around these messages to know if that makes sense.
It's not currently possible to customise the stream created by createExternalExtensionProvider() to filter these messages before they get to StreamProvider.
The text was updated successfully, but these errors were encountered:
I'm using
createExternalExtensionProvider()
to create a Provider to interact with MetaMask from another browser extension. This works well, but a side-effect is that a lot of warnings are logged to the console:I looked into this, and my understanding is as follows:
ObjectMultiplex
from @metamask/object-multiplexObjectMultiplex
stream receives a message for a named substream that has not been created, so such messages will be ignored.publicConfig
named substreamPort
opened to communicate with MetaMask from my extensionpublicConfig
stream.publicConfig
substream, so web pages using MetaMask's provider don't show these warnings: https://github.com/MetaMask/metamask-extension/blob/c40dbb1ec72b91827debb2fffba4097a838f21c7/app/scripts/contentscript.js#L254StreamProvider
in this repo that creates the ObjectMultiplex doesn't ignorepublicConfig
messages:providers/src/StreamProvider.ts
Line 70 in 126a8c8
Should
StreamProvider
ignore these messages itself, like MetaMask's contentscript does? I was tempted to open a PR to do this, but I don't have enough understanding of the legacy context around these messages to know if that makes sense.It's not currently possible to customise the stream created by
createExternalExtensionProvider()
to filter these messages before they get toStreamProvider
.The text was updated successfully, but these errors were encountered: