Skip to content

fix: allow excessive hydration to fix hanging isReconnecting state - #3492

Closed
dalechyn wants to merge 3 commits into
wevm:mainfrom
dalechyn:patch-1
Closed

dalechyn wants to merge 3 commits into
wevm:mainfrom
dalechyn:patch-1

Conversation

@dalechyn

Copy link
Copy Markdown
Contributor

As far as I've understood, the const active = useRef(true) was there to really make sure the effect is run just once as React doesn't guarantee that an effect won't be re-run once again, and for the same reason the dependencies were empty to minimize the redundant effect calls.

However, I think the effect still has to be run as during hot-reload component might get remounted with all connectors hanging in isReconnecting: true state.

Using this as a workaround for now.

Might fix #3490, yet also prune to excessive re-connects that might cause UI regressions, idk.

Description

What changes are made in this PR? Is it a feature or a bug fix?

Additional Information

Before submitting this issue, please make sure you do the following.

  • Read the contributing guide
  • Added documentation related to the changes made.
  • Added or updated tests (and snapshots) related to the changes made.

As far as I've understood, the `const active = useRef(true)` was there to really make sure the effect is run just once as React doesn't guarantee that an effect won't be re-run once again, and for the same reason the dependencies were empty to minimize the redundant effect calls.

However, I think the effect still has to be run as during hot-reload component might get remounted with all connectors hanging in `isReconnecting: true` state.

Using this as a workaround for now.

Might fix wevm#3490, yet also prune to excessive re-connects that might cause UI regressions, idk.
@changeset-bot

changeset-bot Bot commented Jan 21, 2024 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 418703a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel

vercel Bot commented Jan 21, 2024

Copy link
Copy Markdown

@dalechyn is attempting to deploy a commit to the wagmi Team on Vercel.

A member of the Team first needs to authorize it.

@vercel

vercel Bot commented Jan 21, 2024 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
wagmi ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 21, 2024 1:25pm

@jxom

jxom commented Mar 18, 2024

Copy link
Copy Markdown
Member

Closing in favor of #3715

This branch was successfully deployed

1 active deployment
Preview – wagmi — 418703ae Deployed Jan 21, 2024 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wagmi stays in the reconnecting: true state during the hot-reload

2 participants