MetaMask / MetaMask/metamask-extension

[Bug]: Enable/Disable Extension - Console error `PortDuplexStream disconnected`

Open
#37,044 1 comment 0 reactions 0 assignees View on GitHub
regression-prod-13.4.0 Sev2-normal team-extension-platform type-bug
Dominant language
TypeScript
Stars
13.2k
Forks
5.6k
Avg merge
2d 5h
Merged PRs (30d)
451

Description

### Describe the bug

When I enable/disable the extension fast (or close and open the browser) and click the MM icon to open and close fast, I get this error `Console error `PortDuplexStream disconnected`
This happens in an old computer (Slimbook Pro2), cannot repro in my latest Mac.

This is in the attempt of trying to reproduce the infinite loading/trouble starting up issue.
I saw this comment from Dan: https://consensys.slack.com/archives/CTQAGKY5V/p1703013584270429?thread_ts=1703012883.010279&cid=CTQAGKY5V

However, I can confirm that triggering this error, still allows me to continue with MM app normally apparently

### Expected behavior

_No response_

### Screenshots/Recordings

https://github.com/user-attachments/assets/4264999c-adc0-4206-a137-7bf395c89ca4

https://github.com/user-attachments/assets/1a360883-91bc-4104-ad75-a2912202f59e

### Steps to reproduce
Note: it's hard for me to repro this in Mac. I could repro in an old computer:
1. Close all browser windows
2. Open browser
3. Open dev console fast
4. Click MM icon
5. Click outside to close it
6. Click MM icon
7. Wait and see error

Alternatively:
1. Open dev console
2. Click on MM icon
3. Click outside (to close the popup)
4. Now Disable and Enable the extension
5. Open quick the dev console
6. Click on MM icon
7. Click outside (to close the popup)
8. Click on MM icon -- wait a bit and see error

### Error messages or log output

```shell

```

### Detection stage

In production (default)

### Version

13.4.0

### 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 reported sequence in Chrome: rapidly open and close the MetaMask popup, then disable and re-enable the extension while watching the developer console. Trace the PortDuplexStream disconnected error and verify that the same sequence no longer produces the console error while the app remains usable.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.