Skip to content

fix: switch chainnamespace/network#2472

Open
lwin-kyaw wants to merge 6 commits into
masterfrom
fix/switch-chain
Open

fix: switch chainnamespace/network#2472
lwin-kyaw wants to merge 6 commits into
masterfrom
fix/switch-chain

Conversation

@lwin-kyaw
Copy link
Copy Markdown
Contributor

@lwin-kyaw lwin-kyaw commented May 7, 2026

Jira Link

Description

  • Fix the Vue Solana provider so it only initializes a Solana client when the active embedded-wallet chain is Solana.
  • Sync the vue-app-new demo with Web3Auth’s multichain chain state for both "Get Connected Chain ID" and the demo switch-chain action.
  • Add safer cleanup/loading behavior around Vue chain transitions.

Problem

  • The Vue Solana provider eagerly tried to connect a Solana client whenever a Solana wallet was present, even if the embedded provider was still on an EVM chain.
  • The vue-app-new demo 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

  • Guard Solana client initialization behind the active Web3Auth chain namespace in the Vue Solana provider.
  • Re-run the Vue Solana provider setup on chain changes and dispose stale clients safely.
  • Update the demo to use Web3Auth useChain() for connected-chain display.
  • Update the demo to use Web3Auth useSwitchChain() for the embedded wallet switch flow.
  • Add loading state to the demo switch-chain button.

How has this been tested?

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • My code follows the code style of this project. (run lint)
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Note

Medium Risk
Touches chain selection/switching and Solana client lifecycle logic; mistakes could cause wallets to connect on the wrong network or leak/dispose clients during rapid chain transitions, but changes are localized to Vue providers and demo UI.

Overview
Aligns the vue-app-new demo’s chain display and switch-chain flow with Web3Auth’s multichain state by using useChain() for connected chain info and useSwitchChain() (with loading/error handling) for switching EVM chains.

Updates the Vue SolanaProvider to only create/connect a Solana Framework Kit client when the active Web3Auth chain namespace is Solana, and adds safer lifecycle handling (watching chain changes, clearing/disposal helpers, and stale-update protection) to avoid leaking or persisting incorrect clients.

Includes package-lock.json churn reflecting dependency metadata/resolution changes.

Reviewed by Cursor Bugbot for commit 803e657. Bugbot is set up for automated code reviews on this repo. Configure here.

@lwin-kyaw lwin-kyaw requested review from a team as code owners May 7, 2026 13:06
@vercel
Copy link
Copy Markdown

vercel Bot commented May 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
web3auth-web Error Error May 14, 2026 4:01am

Request Review

Comment thread demo/vue-app-new/src/components/AppDashboard.vue
arch1995
arch1995 previously approved these changes May 7, 2026
Comment thread demo/vue-app-new/src/components/AppDashboard.vue Outdated
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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 372481d. Configure here.

Comment thread demo/vue-app-new/src/components/AppDashboard.vue Outdated
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