Skip to content

fix(connectors): retry failed WalletConnect initialization - #5294

Open
snuff12 wants to merge 1 commit into
wevm:mainfrom
snuff12:fix/walletconnect-provider-initialization-retry
Open

snuff12 wants to merge 1 commit into
wevm:mainfrom
snuff12:fix/walletconnect-provider-initialization-retry

Conversation

@snuff12

@snuff12 snuff12 commented Nov 9, 2026

Copy link
Copy Markdown

Fixes #5293

After EthereumProvider.init() rejects, the WalletConnect connector keeps the rejected providerPromise. Later connection attempts therefore fail with the same error even when initialization can succeed again.

Clear the cached promise on rejection only when it still refers to the attempt being awaited. Preserve the original rejection, concurrent initialization sharing, and the successful provider cache.

Add a patch changeset and regression tests covering shared initialization, concurrent recovery, consecutive failures, and connection/event cleanup after automatic setup fails.

Validation:

  • New regression tests: 4 pass on the fix; 3 fail and the successful-sharing control passes on the base commit.
  • Connector unit tests: 7 files / 15 tests pass using an isolated connector configuration.
  • Clean core/connectors builds, connectors type checks, publint/attw, Biome, and git diff --check pass.
  • Real EthereumProvider/SignClient initialization with a one-time storage failure recovers on the same connector after the fix. The local connection check keeps EthereumProvider connect/enable and Wagmi event handling real; remote wallet approval is a fixture.
  • The unchanged public reproduction also recovers with the candidate's compiled connector and EthereumProvider 2.26.0: the first call rejects, then both later calls initialize successfully.

The full RPC/fork/browser suite was not run. The existing connector setup test logs a happy-dom fetch-abort message during teardown after passing; the new regression file does not produce it. Actual wallet approval, signatures, and transactions are outside this test's scope.

@vercel

vercel Bot commented Nov 9, 2026

Copy link
Copy Markdown

@snuff12 is attempting to deploy a commit to the Wevm Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot

changeset-bot Bot commented Nov 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 230cda9

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 Patch
@wagmi/solid 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

This branch has not been deployed

No deployments
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.

WalletConnect connector cannot recover after a failed initialization

1 participant