web3modal icon indicating copy to clipboard operation
web3modal copied to clipboard

[bug] Disconnecting wallet from wagmi hook doesn't trigger SIWE on reconnect

Open chaffy999 opened this issue 1 year ago • 1 comments

Link to minimal reproducible example

https://codesandbox.io/p/devbox/vite-react-forked-5hydhc

Summary

Hello everyone,

I’m encountering a bug since migrating to the latest version of @reown/appkit. When I disconnect my wallet from the AppKit interface, everything works fine, and the SIWE authentication is properly triggered. However, if I disconnect the wallet using the wagmi hook useDisconnect, as indicated in the documentation, the SIWE trigger does not occur when I try to reconnect.

I created a CodeSandbox to reproduce the bug in question.

Thanks for your help.

List of related npm package versions

"@reown/appkit": "^1.0.6", "@reown/appkit-adapter-wagmi": "^1.0.6", "@reown/appkit-siwe": "1.0.6", "siwe": "2.3.2", "viem": "^2.21.15", "wagmi": "^2.12.14"

chaffy999 avatar Oct 04 '24 08:10 chaffy999

@chaffy999

encountered the same issue, the workaround I found was using the wagmiAdapters connectionControllerClient.disconnect() directly which will trigger it

2facedsquid avatar Oct 08 '24 12:10 2facedsquid

https://github.com/reown-com/appkit/pull/3121/files @chaffy999 @2facedsquid this is the first disconnect improvement we're pushing in the next release. We'll make sure your issue is fixed, too as part of this or shortly thereafter. thank you!

arein avatar Oct 21 '24 05:10 arein

the fix was released in in v.1.1.7 - customers reported the fix works - closing

arein avatar Oct 21 '24 17:10 arein