Conversation
|
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. |
Builds ready [fffe69d]
Page Load Metrics (258 ± 245 ms)
Bundle size diffs [🚀 Bundle size reduced!]
|
Builds ready [7911aef]
Page Load Metrics (540 ± 458 ms)
Bundle size diffs [🚀 Bundle size reduced!]
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #26453 +/- ##
===========================================
- Coverage 70.12% 70.12% -0.01%
===========================================
Files 1428 1428
Lines 50103 50089 -14
Branches 13896 13894 -2
===========================================
- Hits 35133 35120 -13
+ Misses 14970 14969 -1 ☔ View full report in Codecov by Sentry. |
| @@ -1,24 +1,4263 @@ | |||
| diff --git a/dist/NetworkController.js b/dist/NetworkController.js | |||
There was a problem hiding this comment.
Is it possible to just release the fixed network-controller package really quickly and then update to it?
There was a problem hiding this comment.
i don't think that'd be realistically possible given the breaking change in 20.0.0 removes providerConfig from state. This is probably why we are still on 19.0.0
https://github.com/MetaMask/core/blob/main/packages/network-controller/CHANGELOG.md#removed
I'm going to guess that you're suggesting this since the patch is not human readable
There was a problem hiding this comment.
Is it possible to just release the fixed network-controller package really quickly and then update to it?
It is not possible to do this in a timely manner, but we need to get this fix into prod asap
|
Do we need to include changes to rerun 120.5 in this PR too? |
yes, that makes sense |
danjm
left a comment
There was a problem hiding this comment.
changing my approval as there will be adding more migration code added here
|
LGTM ! Tested locally and worked as described. One thing as Nit is we can add an e2e test for editing rpcURL for selected network in the future ticket |
|
Builds ready [957f59a]
Page Load Metrics (140 ± 151 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
|
patch branch for network-controller 19.0.0 https://github.com/MetaMask/core/compare/jl/network-controller%4019.0.0-patch?expand=1 |



Description
Currently it is not possible to change the rpcUrl for an existing network configuration without first removing it then re-adding it. This poses an issue on extension when the rpcUrl for the currently selected network is changed via the
NetworkForm. The NetworkForm first removes the existing networkClient which causes the SelectedNetworkController to replace any references to the networkClientId being removed with the selectedNetworkClientId, but the problem is that the selectedNetworkClientId is no longer valid at that point and leaves the SelectedNetworkController in a corrupted state.Really what we want in this case is to allow the network configuration to be updated in place by id, but only if the rpcUrl isn't changing to one that already exists on a different network configuration.
This PR achieves that by getting rid of the
removeNetworkConfiguration()call triggered byNetworkFormand patching theNetworkControllerwith changes from MetaMask/core#4614 which allow network configurations to have their rpcUrl updated in place. It also keeps the existing patch that removed alookupNetwork()call ininitializeProvider().Related issues
Related: #26309
Manual testing steps
chrome.storage.local.get(console.log)for NetworkController.networkConfigurationschrome.storage.local.get(console.log), the id for the network configuration that was just edited should not have changed in NetworkController.networkConfigurationschrome.storage.local.get(console.log), the dapp should have an entry for the network client we added above SelectedNetworkController.domainschrome.storage.local.get(console.log), the dapp should still be pointed at the same network client id in SelectedNetworkController.domains which should still exist in NetworkController.networkConfigurationsScreenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist