MetaMask / MetaMask/metamask-extension

[Bug]:

Open
#36,018 2 comments 0 reactions 0 assignees View on GitHub
area-customNetworks external-contributor regression-prod-13.2.3 Sev2-normal team-wallet-api-platform-deprecated type-bug
Dominant language
TypeScript
Stars
13.2k
Forks
5.6k
Avg merge
2d 5h
Merged PRs (30d)
451

Description

### Describe the bug

When a user is connected to my dApp on L1X (chainId 1066) and the upper network selector shows L1X, the approve() call fails with internal JSON-RPC error if the lower ‘tokens view’ dropdown is set to another network. DApps cannot control that lower dropdown, so this creates user friction. Can this behavior be fixed so only the upper active network affects transactions?

### Expected behavior

_No response_

### Screenshots/Recordings

_No response_

### Steps to reproduce

Ahh, got it 👌 — so it’s **not just MetaMask Mobile**, you’re seeing the same behavior on **MetaMask Desktop (browser extension)** too.

That’s even more important, because it means the bug is in their **core network handling**, not just mobile UI.

---

### 🐞 Updated Steps to Reproduce (Desktop + Mobile)

1. **Setup**

* Install MetaMask (extension or mobile).
* Add a custom network (**L1X**, chainId `1066` / `0x42A`).
* Deploy or use any ERC-20 token on L1X.
* Build a simple dApp that connects to MetaMask and calls `token.approve(spender, amount)`.

2. **Connect to the dApp**

* Open the dApp.
* When prompted, allow MetaMask to switch to **L1X** (`wallet_switchEthereumChain`).
* Confirm `eth_chainId` is `0x42A`.

3. **Change lower-side network filter**

* In MetaMask, open the **Assets / Tokens view**.
* Switch the **lower dropdown (network filter)** from L1X to another chain (e.g., BNB Smart Chain).
* Upper dropdown (main network selector) still shows **L1X**.

4. **Trigger a transaction**

* Back in the dApp, call `approve()` on the ERC-20.
* Transaction fails with:

```
Internal JSON-RPC error.
```

---

### ✅ Expected Behavior

* As long as the **upper active network** (main selector) is correct, the transaction should go through.
* The **lower-side network filter** should not affect JSON-RPC calls or transaction signing.

### ❌ Actual Behavior

* If the **lower filter** is different from the upper active network, MetaMask blocks the transaction with `Internal JSON-RPC error`.
* This happens in **both desktop extension and mobile**.
* DApps cannot programmatically control or correct this, leaving users stuck.

---

This is clearly a **MetaMask bug / UX flaw** because the lower filter is only supposed to control **token display**, not transaction routing.

---

### Error messages or log output

```shell

```

### Detection stage

In production (default)

### Version

13.2.3

### Build type

None

### Browser

Chrome

### Operating system

Linux

### Hardware wallet

_No response_

### Additional context

_No response_

### Severity

_No response_

Contributor guide

Open the contributing guide

Research direction

No source file, test, or entry point is named. Reproduce the issue in MetaMask extension version 13.2.3 by switching the Assets/Tokens view network away from L1X while the upper selector remains on chainId 1066, then trace the transaction-routing behavior. Done means approve() succeeds when only the lower network filter differs, on desktop and mobile if both implementations are in scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.