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

Fix race condition in injected.ts #4207

Merged
merged 2 commits into from
Sep 27, 2024
Merged

Fix race condition in injected.ts #4207

merged 2 commits into from
Sep 27, 2024

Conversation

Smert
Copy link
Contributor

@Smert Smert commented Aug 17, 2024

It can hangs if "once" will catch an event with unexpected chainId.

UPD: But need to correctly unsubscribe handler( Maybe you can suggest better fix.

It can hangs if "once" catches an event with unexpected chainId
Copy link

changeset-bot bot commented Aug 17, 2024

🦋 Changeset detected

Latest commit: 2b38f2d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@wagmi/connectors Patch
@wagmi/core Patch
wagmi Patch
@wagmi/vue Patch

Not sure what this means? Click here to learn what changesets are.

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

Copy link

vercel bot commented Aug 17, 2024

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 Sep 27, 2024 6:04pm

@tmm
Copy link
Member

tmm commented Aug 20, 2024

What's the issue? Mind dropping a minimal reproduction.

@Smert
Copy link
Contributor Author

Smert commented Aug 25, 2024

Its heisenbug. switchChain can hang. I don't know why, but config.emitter can emit change event with another chainId and the promise will not be resolved

@tmm tmm force-pushed the main branch 2 times, most recently from 026feab to 9b7cc38 Compare September 11, 2024 21:57
@tmm tmm merged commit 56f2482 into wevm:main Sep 27, 2024
5 of 10 checks passed
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.

2 participants