fix: Prevent invalid selectedNetworkClientId on startup#33480
Merged
DDDDDanica merged 2 commits intochore/master-sync-12.20.0from Jun 4, 2025
Merged
fix: Prevent invalid selectedNetworkClientId on startup#33480DDDDDanica merged 2 commits intochore/master-sync-12.20.0from
DDDDDanica merged 2 commits intochore/master-sync-12.20.0from
Conversation
Contributor
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
If `selectedNetworkClientId` in NetworkController state does not point to an RPC endpoint and therefore does not also point to a network client, then we automatically correct it to point to the default RPC endpoint of the first network (sorted by chain ID). This allows the wallet to start normally. This change is being added as a patch because we do not want to upgrade to 23.5.1, as doing so would fix another unrelated bug, and we want to limit the scope of the change.
Contributor
Author
|
@metamaskbot update-policies |
Collaborator
|
Policies updated. 🧠 Learn how: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff |
Collaborator
✨ Files requiring CODEOWNER review ✨🧩 @MetaMask/extension-devs
📜 @MetaMask/policy-reviewers Tip Follow the policy review process outlined in the LavaMoat Policy Review Process doc before expecting an approval from Policy Reviewers.
🔗 @MetaMask/supply-chain
|
Collaborator
Builds ready [eb9ee9a]
UI Startup Metrics (1184 ± 71 ms)
Benchmark value 11 exceeds gate value 9 for firefox browserify home mean setupStore Benchmark value 1395 exceeds gate value 1380 for firefox webpack home mean load Benchmark value 1395 exceeds gate value 1380 for firefox webpack home mean domContentLoaded Benchmark value 42 exceeds gate value 38 for firefox webpack home mean firstReactRender Benchmark value 1377 exceeds gate value 1360 for firefox webpack home mean loadScripts Benchmark value 2042 exceeds gate value 1935 for firefox webpack home p95 uiStartup Benchmark value 1825 exceeds gate value 1660 for firefox webpack home p95 load Benchmark value 1825 exceeds gate value 1660 for firefox webpack home p95 domContentLoaded Benchmark value 1806 exceeds gate value 1630 for firefox webpack home p95 loadScripts Sum of mean exceeds: 54ms | Sum of p95 exceeds: 613ms Sum of all benchmark exceeds: 667ms |
329624c
into
chore/master-sync-12.20.0
148 of 152 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
If
selectedNetworkClientIdin NetworkController state does not point to an RPC endpoint and therefore does not also point to a network client, then we automatically correct it to point to the default RPC endpoint of the first network (sorted by chain ID). This allows the wallet to start normally.This change is being added as a patch because we do not want to upgrade to 23.5.1, as doing so would fix another unrelated bug, and we want to limit the scope of the change.
Related issues
See MetaMask/core#5851 for the equivalent changes to network-controller that were copied here.
Also see MetaMask/metamask-mobile#15941 for a similar fix on the mobile side.
Manual testing steps
yarn start.selectedNetworkClientIdand change it to something invalid.selectedNetworkClientIdshould no longer be invalid.yarn webpack --watchinstead ofyarn start(to test MV2).Screenshots/Recordings
(N/A)
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist