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
After some digging, we've seen that the issue comes from WalletConnect and wallets that use it, like walletConnectWallet, okxWallet, trustWallet, rainbowWallet, tokenPocketWallet.
Wagmi should be able to handle a delay from WalletConnect servers response and ignore its response until it responds, not affecting the rest of the connectors for wallets.
It seems that the WS requests to wss://relay.walletconnect.com/ keep pending, and after a time out, it continues and the wagmi account status is finally as expected.
No idea why it doesn't happen on the first connect, and only after a reconnection.
We've disabled temporarily those wallets to make it work.
Check existing issues
Describe the bug
I'm trying to consistently listen to onConnect
but it isn't triggered when reloading the page by enabling metamask to run on the site
Link to Minimal Reproducible Example
https://stackblitz.com/edit/new-wagmi-tfvypz?file=src%2FApp.tsx
Steps To Reproduce
Added logging for useAccountEffect.onConnect conditions
wagmi/packages/react/src/hooks/useAccountEffect.ts
Lines 34 to 40 in 34df0c8
https://stackblitz.com/edit/new-wagmi-tfvypz?file=src%2FApp.tsx
open preview in new tab
First time connecting, click Injected: 🟢
Reload page: 🟢
Reload by enabling metamask to run on this site: 🔴
What Wagmi package(s) are you using?
wagmi
Wagmi Package(s) Version(s)
2.12.7
Viem Version
2.0.0
TypeScript Version
5.2.2
Anything else?
No response
The text was updated successfully, but these errors were encountered: