Skip to content
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

bug: wallet involuntarily disconnects when the user switches to certain chains from inside the metamask browser extension #1941

Closed
1 task done
ryanberckmans opened this issue Mar 3, 2023 · 3 comments · Fixed by #2043

Comments

@ryanberckmans
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Package Version

0.11.3

Current Behavior

As indicated in this thread and in MetaMask/metamask-extension#13375, despite passing { shimDisconnect: true, shimChainChangedDisconnect: true }, the wallet can still sometimes involuntarily disconnect when the user switches the chain from inside the metamask browser extension.

For context,, when testing this on a mature non-wagmi app such as Uniswap, we're able to switch (to, from) any chain in the metamask browser extension without the Uniswap UI involuntarily disconnecting.

Expected Behavior

After connecting in the app, never spontaneously disconnect, regardless of which network a user switches to in their wallet, even if that network is unsuppoted/unconfigured in the current wagmi client instance.

Steps To Reproduce

Non-deterministic reproduction (sometimes it disconnects, sometimes it doesn't):

  1. load the link below (the only change from new.wagmi.sh is the addition of shim/shimDisconnect: true in Metamask connector
  2. connect wallet
  3. switch network between goerli and zkSyncTestnet in metamask browser extension. Sometimes it'll disconnect in the app.

Link to Minimal Reproducible Example (StackBlitz, CodeSandbox, GitHub repo etc.)

https://stackblitz.com/edit/new-wagmi-utduc3?file=src%2Fwagmi.ts

Anything else?

No response

@thebuidler
Copy link

We are also having this issue. Any progress?

@tmm
Copy link
Member

tmm commented Mar 20, 2023

Fix here: wevm/references#177

Copy link
Contributor

This issue has been locked since it has been closed for more than 14 days.

If you found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest wagmi version. If you have any other comments you can create a new discussion.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants