MetaMask / MetaMask/metamask-mobile
[Bug]: Switching networks from a dApp doesn't function as expected
- Dominant language
- TypeScript
- Stars
- 3k
- Forks
- 1.7k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 669
Description
**Describe the bug**
When switching networks from PancakeSwap, users encounter a discrepancy where the wallet view updates to display the icon of the newly selected network but continues to show tokens from the previously selected network. Additionally, while the MetaMask icon on the dApp screen reflects the newly selected network and a network switch notification is presented, the dApp itself remains on the previous network. This results in transactions being created on the previous network, accompanied by an error message regarding a mismatch in chain IDs.
**Expected behavior**
-
**Screenshots/Recordings**
https://github.com/user-attachments/assets/0f5d591a-1ad0-40bb-84cf-eb2f34b39abd
**Steps to reproduce**
1. Connect to [PancakeSwap](https://pancakeswap.finance/)
2. Switch to a network other than the network selected in the wallet
**Error messages or log output**
```shell
```
**Detection stage**
During release testing
**Version**
7.38.0(1521)
**Build type**
None
**Device**
iPhone 15, Samsung S24+
**Operating system**
iOS, Android
Contributor guide
Research direction
Reproduce the issue in PancakeSwap on the listed iPhone 15 and Samsung S24+ environments, switching away from the wallet's selected network. Compare the wallet view, dApp network indicator, and transaction chain after the switch. Done means both wallet and dApp use the newly selected network and transactions no longer fail with a chain ID mismatch.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react-native, typescript
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100