web3-onboard icon indicating copy to clipboard operation
web3-onboard copied to clipboard

[Bug] Onboard wallet state not updating correctly when switching chains with Coin98 wallet

Open rueyce opened this issue 1 year ago • 3 comments

Current Behavior

When switching to another chain with injected Coin98 wallet, onboard wallet state does not update correctly.

Expected Behavior

Onboard wallet state should reflect new chain and wallet address.

Steps To Reproduce

Using example in the docs

  1. Visit https://onboard.blocknative.com/examples/connect-wallet
  2. Connect with Coin98 wallet
  3. Using the transaction preview widget on the bottom right of the page, change to a new network
  4. After completing the network change request in the wallet, onboard state still shows previous chain and wallet address

Alternatively, https://github.com/rueyce/web3-onboard-vuejs-example which is just a slight modification to the docs-provided Vuejs example (I am using Vue but believe it is not framework-related)

What package is effected by this issue?

@web3-onboard/core

Is this a build or a runtime issue?

Runtime

Package Version

2.21.0

Node Version

18.17.0

What browsers are you seeing the problem on?

Chrome

Relevant log output

No response

Anything else?

Console showing wallet state changes. Logs 3 to 6 are recorded when I trigger the network change, showing that it does update but quickly reverts to the original state.

image

Sanity Check

  • [X] If this is a build issue, I have included my build config. If this is a runtime issue, I have included reproduction steps and/or a Minimal, Reproducible Example.

rueyce avatar Sep 11 '23 17:09 rueyce

hey @rueyce we'll take a look at this!

taylorjdawson avatar Sep 22 '23 18:09 taylorjdawson

Hello, I'm also seeing this same issue with MetaMask. Perhaps this is an issue with injected wallets in general?

I am able to trigger an update consistently when switching from Mainnet => Arbitrum or between Arbitrum and Base, but it does not trigger when switching from Arbitrum => Mainnet or Arbitrum => Goerli

My version is: "@web3-onboard/core": "^2.21.2"

jeffywu avatar Feb 06 '24 17:02 jeffywu

Update since the issue was opened by me: We're no longer encountering the issue described in the opening post. What happens now, for reference:

  • Doing onboard.setChain to a foreign chain when connected with a chain-limited wallet now gives an error, which is expected.
  • Switching to another different-chain wallet directly in the extension now disconnects it from the dApp. Importantly, it's no longer using nor displaying the wrong wallet and chain as previously described.

Thanks for looking at this and please feel free to close this or as you see fit.

Versions:

"@web3-onboard/core": "^2.21.2",
"@web3-onboard/injected-wallets": "^2.10.9",

Coin98 chrome extension version 9.1.6

rueyce avatar Feb 17 '24 11:02 rueyce