-
-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provider emits warning: ObjectMultiplex - orphaned data for stream "publicConfig" #294
Comments
@h4l Out of curiosity are these warning messages indicative of anything we need to actually worry about, or are they benign? Also, how is your extension-to-extension functionality going? I've gotten my extension to work with MetaMask but recently it stopped being able to connect (my |
Hey @smilingkylan. The warnings are benign as far as I could see. I forget the exact details, but I believe they were related to a historical way that messages were sent between content scripts and the MetaMask extension. The cross-extension connection works reliably for me as far as I know (I just checked again and it seems OK). I'm using Wagmi to handle the interaction with the wallets. It took a bit of trial and error to get everything working smoothly. My extension is open source, so feel free to check out how mine is working if it's helpful.
I recall a particular thing to look out for that was screwing things up. At one point I had a component above the You can find the link to install my extension from the readme here. I've not been working on it recently though, I was getting kinda burnt out from lack of engagement from Reddit web3/avatar/token community users it's for. 🫤 |
@h4l Thanks a ton. That is very helpful. I just spent a couple days debugging the MM provider itself just to learn that extension popups and content scripts don't share context. I was wondering why my components weren't getting |
@smilingkylan You're welcome, glad it helped. The extension sandboxing is tricky, I've hit that kind of issue myself a few times when I started building extensions — implementing some functionality in one part of the extension only to realise it was isolated from another part! It's a bit more like building a website with separate backend and frontend compared to just building a single-page app. Extensions are a bit of an underrated superpower I think! |
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: