MetaMask / MetaMask/metamask-extension

Error: state.SelectedNetworkController.perDomainNetwork is missing from SelectedNetworkController state

Open
#30,780 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area-sentry 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

Sentry Issue: [TEST-METAMASK-B0X](https://metamask.sentry.io/issues/6061432264/?referrer=github_integration)

```
Error: state.SelectedNetworkController.perDomainNetwork is missing from SelectedNetworkController state
at None (/metamask/background-2.js:1:1054)
at Object.migrate (/metamask/background-2.js:1:1442)
at o.migrateData (/metamask/background-0.js:1:251943)
at async Me (/metamask/background-8.js:1:14712)
at async Se (/metamask/background-8.js:1:10857)
...
(1 additional frame(s) were not displayed)
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the SelectedNetworkController state migration behind the background-2.js and background-0.js stack frames, then inspect how perDomainNetwork is handled when older state is loaded. Reproduce the Sentry failure and add coverage for the missing-field case; done means migration completes without this error and the regression is tested.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.