Open holic opened 6 months ago
I was previously seeing an issue with deleting these custom networks but turns out MetaMask won't let you delete a network you're currently connected to. I was able to delete it after switching to another network.
Okay, narrowed this down to MetaMask not handling a lack of net_version
RPC method. Updated the issue description.
from @jiexi :
https://github.com/MetaMask/providers/blob/4f12239247b30a03884df5c6623429d215e78e4f/src/StreamProvider.ts#L198-L202 networkVersion ends up being sent to the provider as loading if net_version fails which is explicitly guarded against in the lines linked in Provider
Possibly related to: https://github.com/MetaMask/metamask-extension/pull/20652
This issue has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 45 days if there is no further activity. The MetaMask team intends on reviewing this issue before close, and removing the stale label if it is still a bug. We welcome new comments on this issue. We do not intend on closing issues if they report bugs that are still reproducible. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 45 days if there is no further activity. The MetaMask team intends on reviewing this issue before close, and removing the stale label if it is still a bug. We welcome new comments on this issue. We do not intend on closing issues if they report bugs that are still reproducible. Thank you for your contributions.
Describe the bug
I have a chain where the old RPC method
net_version
was not enabled/whitelisted by default and we noticed that MetaMask switching chains to this network would not emit thechainChanged
event that tools like wagmi depend on.Expected behavior
I would expect MetaMask to use
eth_chainId
for this initial call, or at least fallback to it, sochainChanged
can be properly emitted in cases wherenet_version
is not supported by the RPC.Screenshots/Recordings
Steps to reproduce
Add a chain where the RPC method
net_version
is disabled. Specifically, ours returnedListen for
chainChanged
events with:Then call
wallet_switchEthereumChain
to the target chain. You'll see the RPC call return but you won't see an event emission, even though the MetaMask extension will have switched to that chain.Error messages or log output
Unclear where to find errors/logs in MetaMask extension.
Version
11.14.1
Build type
None
Browser
Brave
Operating system
MacOS
Hardware wallet
No response
Additional context
No response
Severity
No response