Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: the chainId is different from the one in the wallet. #1112

Closed
AliceW-03 opened this issue Nov 1, 2024 · 1 comment
Closed

[Bug]: the chainId is different from the one in the wallet. #1112

AliceW-03 opened this issue Nov 1, 2024 · 1 comment

Comments

@AliceW-03
Copy link

AliceW-03 commented Nov 1, 2024

SDK

Web

Provide environment information

telegram desktop version 5.6.3 x64

MetaMask SDK Version

0.30.1

MetaMask Mobile app Version

7.33.0

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

telegram webapp

Describe the Bug

When I connect metamask in my telegram webapp, switch chains, and then reload the page, the chainId is different from the one in the wallet.
I noticed that you store a .MMSDK_cached_chainId in the cache to persist the login. After switching chains, this field retains the old chainId. When the page is reloaded, the retrieved chainId becomes the old value, even though the wallet has already switched to the new chain.

Expected Behavior

The chainId retrieved after reloading the page should match the one in the wallet.

Link to reproduction - Issues with a link to complete (but minimal) reproduction code will be addressed faster

https://metamask-cache-chain-id.vercel.app/

To Reproduce

I deployed a reproduction in my test bot. You can enter the bot and type /metamask.

  1. connect wallet
  2. switch chain
  3. reload in the top right corner.
@christopherferreira9
Copy link
Collaborator

Hi @AliceW-03 ! I wasn't able to reproduce this issue, can you check if the correct steps were followed?

Screen.Recording.2024-11-04.at.17.20.46.mov

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

No branches or pull requests

2 participants