MetaMask / MetaMask/metamask-extension

[Bug]: Preferences - showTestNetworks value is set to false despite being true after onboarding using a test network

Open
#45,237 0 comments 0 reactions 0 assignees View on GitHub
regression-prod-13.37.0 Sev2-normal team-onboarding type-bug
Dominant language
TypeScript
Stars
13.2k
Forks
5.6k
Avg merge
2d 5h
Merged PRs (30d)
451

Description

### Describe the bug

Whenever we onboard and add a custom Localhost network using chainId 1337, after finishing the onboarding that network is selected. However, the show test network property in the wallet state is set to false.

This has 2 consequences:
- after adding the network in the onboarding page, that network doesn't appear (as show testnets is set false)
- we need to workaround this on the fixture validation until that is sorted out

### Expected behavior

If we add a testnet in the onboarding page, we should automatically enable show testnets, so we see that network in the onboarding page and the property is set to true

### Screenshots/Recordings

Image

https://github.com/user-attachments/assets/10e65c3f-e0ae-4315-8c7c-f723bc6c6852

### Steps to reproduce

1. Onboard
2. Before opening the wallet, click Settings
3. Open General Settings and add a localhost network using chain id 1337 -> on a terminal run `yarn anvil --chain=1337` inside the extension repo
4. See after confirming, the network is not visible in that screen
5. Finish onboarding, and see localhost is selected, however check the wallet preference controller and see show test networks is disabled

### Error messages or log output

```shell

```

### Where was this bug found?

Live version (from official store)

### Version

13.37.0

### Build type

None

### Browser

Chrome

### Operating system

MacOS

### Hardware wallet

_No response_

### Additional context

_No response_

### Severity

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the onboarding flow for adding a custom Localhost network and the wallet preference controller named in the report. Reproduce with `yarn anvil --chain=1337`, then verify that adding chain ID 1337 makes the network visible and sets show test networks to true after onboarding.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.