fix(wagmi): add resetSSRState method to prevent cross-request state leakage - #5614
fix(wagmi): add resetSSRState method to prevent cross-request state leakage#5614Khizr97 wants to merge 1 commit into
Conversation
…eakage In Next.js App Router with SSR, the WagmiAdapter is typically created as a module-level singleton. This can cause cross-request state leakage where one user's wallet connection state bleeds into another user's server-rendered HTML. This commit adds a `resetSSRState()` method that resets the wagmi config state when `cookieToInitialState` returns undefined (i.e., when the user has no wallet cookies). This prevents showing another user's wallet address in SSR. REOWN-4523 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
Thank you for your contribution! We ask that you please read and sign our CTA Document before we can accept your contribution. You can sign the CTA simply by posting a Pull Request Comment with the following text: I have read the CTA Document and I hereby sign the CTA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
9 Skipped Deployments
|
Visual Regression Test Results ✅ PassedChromatic Build: https://www.chromatic.com/build?appId=6493191bf4b10fed8ca7353f&number=850 👉 Please review the visual changes in Chromatic and accept or reject them. |
Summary
resetSSRState()method to WagmiAdapter to prevent cross-request state leakage in Next.js SSRFixes REOWN-4523
Changes
packages/adapters/wagmi/src/client.ts
resetSSRState()method that clears connections, sets current to null, and status to 'disconnected'examples/next-wagmi-app-router/src/app/layout.tsx
examples/next-wagmi-app-router/src/config/index.ts
ssr: trueto WagmiAdapter configurationpackages/adapters/wagmi/src/tests/client.test.ts
resetSSRState()methodTest plan
🤖 Generated with Claude Code