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

wallet get disconnected of page refreshes and cookies was not deleted this will happening when we dissconnect on the dynamic page #4073

Closed
1 task done
arunkumar201 opened this issue Jun 21, 2024 · 6 comments

Comments

@arunkumar201
Copy link

Check existing issues

Describe the bug

i am using wagmi and web3Modal (nextjs 14) , i am getting issue with wallet connection
-The wallet connection occasionally disconnects upon page changes or occasional page refreshes. I've implemented cookies with SSR (server-side rendering) set to true.

i am using latest versions
-i followed the https://github.com/wevm/wagmi/blob/main/playgrounds/next/src/wagmi.ts playground example

Link to Minimal Reproducible Example

https://github.com/arunkumar201/web3-siwe

Steps To Reproduce

wagmi.disconnect.on.page.refreshes.mp4

What Wagmi package(s) are you using?

wagmi, @wagmi/connectors, @wagmi/core

Wagmi Version

latest

Viem Version

latest

TypeScript Version

5.4.4

Anything else?

i am using nextjs + cookies based wallet session.

@tmm
Copy link
Member

tmm commented Jun 21, 2024

The example you provided is not minimal. Please attach a minimal reproduction that only uses Wagmi/Viem without third-party connect libraries.

@tmm tmm closed this as not planned Won't fix, can't repro, duplicate, stale Jun 21, 2024
arunkumar201 added a commit to arunkumar201/wagmi that referenced this issue Jun 22, 2024
@arunkumar201
Copy link
Author

arunkumar201 commented Jun 22, 2024

@tmm ,i have tested using wagmi next playground example , same issue is being encountered .

@tmm
Copy link
Member

tmm commented Jun 24, 2024

@arunkumar201
Copy link
Author

arunkumar201 commented Jun 25, 2024

thanks @tmm, same issue still persists: When connecting on the home page and then navigating to any dynamic page, a hard refresh on the dynamic page causes problems. If we disconnect the wallet, return to the home page, reconnect the wallet, and refresh the page, the wallet disconnects again. The 'wagmi.io.metamask.disconnected' cookie value remains true and does not get updated. This issue was tested on the latest Next.js playground example using the updated version of getConfig() .

@kr-arunp
Copy link

kr-arunp commented Jul 5, 2024

Updated the SSR guide: https://wagmi.sh/react/guides/ssr#persistence-using-cookies

still wallet is getting disconnected - #4073 (comment)

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 questions or comments you can create a new discussion thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 20, 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

No branches or pull requests

3 participants