fix: switch chainnamespace/network#2472
Open
lwin-kyaw wants to merge 20 commits into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
arch1995
previously approved these changes
May 7, 2026
803e657 to
4e11a15
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ba6d624. Configure here.
| if (isConnected && connection?.ethereumProvider) { | ||
| const shouldBindToWagmi = isConnected && chainNamespace === CHAIN_NAMESPACES.EIP155 && Boolean(connection?.ethereumProvider); | ||
|
|
||
| if (shouldBindToWagmi && connection?.ethereumProvider) { |
Member
There was a problem hiding this comment.
already present in should
|
|
||
| function Web3AuthWagmiProvider({ children }: PropsWithChildren) { | ||
| const { isConnected, connection } = useWeb3Auth(); | ||
| const { isConnected, connection, chainNamespace } = useWeb3Auth(); |
Member
There was a problem hiding this comment.
is there no change in solana react provider?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Jira Link
Description
vue-app-newdemo with Web3Auth’s multichain chain state for both "Get Connected Chain ID" and the demo switch-chain action.Problem
vue-app-newdemo relied on wagmi’s EVM chain state for chain display/switching, which could drift from Web3Auth after chain changes triggered from the wallet-services UI.Changes
useChain()for connected-chain display.useSwitchChain()for the embedded wallet switch flow.How has this been tested?
Screenshots (if appropriate)
Types of changes
Checklist
Note
Medium Risk
Touches multichain switching, consent-state transitions, and provider event handling across
@web3auth/no-modaland the Vue/Wagmi/Solana adapters, so regressions could affect connection stability and chain/account state. Changes are localized and include new tests for key race conditions and wallet-services disconnect behavior.Overview
Improves multichain correctness when switching between EVM and Solana. The Vue demo and adapters now gate EVM/Solana features by the active
chainNamespace, add an explicit switch chain namespace action viaweb3Auth.switchChain, and sanitize persisted session config (namespaces/chains/default chain and AA chain configs) when restoring from storage.Hardens provider syncing and lifecycle handling. The Vue Solana provider only instantiates a Framework Kit client when the active Web3Auth chain is Solana, re-syncs on chain changes, and safely disposes stale clients to avoid async race overwrites. Wagmi providers (React/Vue) now bind/unbind based on EIP-155 namespace, track the last bound provider/connector, and suppress spurious disconnect cascades during rebinds.
Fixes no-modal connector edge cases.
AuthConnectornow binds/unbinds ws-embedaccountsChangedlisteners with cleanup, switches chains using hexchainIdformatting, and renames link-account params (walletConnector→connectorToLink) with safer disconnect-on-failure.Web3AuthNoModalavoids downgrading status during CONNECTED/AUTHORIZED consent races, delays plugin connection until consent is resolved, emitspendingUserConsenton CONNECTED, and uses storedcurrentChainIdduring rehydration.Updates deps and adds coverage. Bumps
@web3auth/ws-embed(and related@web3auth/auth,@toruslabs/base-controllers,viem/ox/ws) and adds tests for ws-embed zero-account disconnect handling, Solana chain preservation, and consent race behavior.Reviewed by Cursor Bugbot for commit 97eb7ca. Bugbot is set up for automated code reviews on this repo. Configure here.