Skip to content

fix: switch chainnamespace/network#2472

Open
lwin-kyaw wants to merge 5 commits intomasterfrom
fix/switch-chain
Open

fix: switch chainnamespace/network#2472
lwin-kyaw wants to merge 5 commits intomasterfrom
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 multichain connection lifecycle and chain-switch behavior; mistakes could cause incorrect chain state or leaked/stale Solana clients during transitions, but changes are scoped to Vue provider/demo wiring.

Overview
Fixes multichain chain-state drift in the Vue demo and embedded Solana client lifecycle.

AppDashboard.vue switches from wagmi chain state to Web3Auth’s useChain()/useSwitchChain() for chain display and EVM chain switching, adds a loading state to the switch button, and bases “next chain” selection on the EVM provider’s current chainId.

SolanaProvider now only instantiates/connects a Framework Kit Solana client when the active Web3Auth chain namespace is Solana, and adds safer cleanup to dispose/clear clients (including stale in-flight creations) on connection/chain changes.

Lockfiles update dependency metadata (notably peer flags) and add nested @emnapi entries under @rolldown.

Reviewed by Cursor Bugbot for commit 378f4ad. 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 Ready Ready Preview, Comment May 8, 2026 5:32pm

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