MetaMask / MetaMask/metamask-extension

[Bug]: Wallet API - MM unresponsive after Send tx request queued after a network switch request

Open
#27,414 0 comments 0 reactions 0 assignees View on GitHub
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

MetaMask is unresponsive after triggering a send transaction request, queued after a Network switch.
The point where it get's stuck is after closing the 1st request (network switch).

This behaviour also causes test flakiness: https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/102370/workflows/92b5b9a4-17a5-4680-af19-316c9b9cc786/jobs/3814610/parallel-runs/2?filterBy=ALL

This has been observed in webpack builds only, but it doesn't necessarily mean that the issue is not present in other builds. I think it's a race condition, that appears more in webpack, given it's faster

### Expected behavior

_No response_

### Screenshots/Recordings

https://github.com/user-attachments/assets/02d5edf2-9744-4ce6-927b-acb839f61870

### Steps to reproduce

1. (webpack build)
2. From dapp 1, trigger a network switch
3. From dapp 2, trigger a send
4. Confirm network switch request
5. Wallet get's unresponsive, and the 2nd request never opens

### Error messages or log output

_No response_

### Detection stage

In production (default)

### Version

develop (webpack build)

### 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

Start by reproducing the five-step sequence in a webpack build and inspect the request queue behavior when a network switch is followed by a send request. Use the linked CircleCI run as evidence of the flakiness; done means the wallet remains responsive, the second request opens after the first is confirmed, and the regression is covered by a reliable test.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, webpack
Domain
frontend, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.