Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: verify core PR 5078 #12755

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft
1 change: 1 addition & 0 deletions app/util/logs/__snapshots__/index.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ exports[`logs :: generateStateLogs generates a valid json export 1`] = `
},
"UserStorageController": {
"hasAccountSyncingSyncedAtLeastOnce": false,
"isAccountSyncingInProgress": false,
"isAccountSyncingReadyToBeDispatched": false,
"isProfileSyncingEnabled": true,
"isProfileSyncingUpdateLoading": false,
Expand Down
1 change: 1 addition & 0 deletions app/util/test/initial-background-state.json
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@
"UserStorageController": {
"hasAccountSyncingSyncedAtLeastOnce": false,
"isAccountSyncingReadyToBeDispatched": false,
"isAccountSyncingInProgress": false,
"isProfileSyncingEnabled": true,
"isProfileSyncingUpdateLoading": false
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
"@metamask/post-message-stream": "^8.0.0",
"@metamask/ppom-validator": "0.36.0",
"@metamask/preferences-controller": "^15.0.1",
"@metamask/profile-sync-controller": "^3.0.0",
"@metamask/profile-sync-controller": "npm:@metamask-previews/[email protected]",
"@metamask/react-native-actionsheet": "2.4.2",
"@metamask/react-native-button": "^3.0.0",
"@metamask/react-native-payments": "^2.0.0",
Expand Down
48 changes: 48 additions & 0 deletions patches/@metamask+network-controller+22.1.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
diff --git a/node_modules/@metamask/network-controller/dist/NetworkController.cjs b/node_modules/@metamask/network-controller/dist/NetworkController.cjs
index cc9793f..e7334e4 100644
--- a/node_modules/@metamask/network-controller/dist/NetworkController.cjs
+++ b/node_modules/@metamask/network-controller/dist/NetworkController.cjs
@@ -525,7 +525,20 @@ class NetworkController extends base_controller_1.BaseController {
let networkChanged = false;
const listener = () => {
networkChanged = true;
- this.messagingSystem.unsubscribe('NetworkController:networkDidChange', listener);
+ try {
+ this.messagingSystem.unsubscribe('NetworkController:networkDidChange', listener);
+ } catch (error) {
+ if (
+ typeof error === 'object' &&
+ error !== null &&
+ 'message' in error &&
+ error.message === 'Subscription not found for event: NetworkController:networkDidChange'
+ ) {
+ // The controller may have been destroyed, so don't worry about it
+ } else {
+ throw error;
+ }
+ }
};
this.messagingSystem.subscribe('NetworkController:networkDidChange', listener);
let updatedNetworkStatus;
@@ -575,7 +588,20 @@ class NetworkController extends base_controller_1.BaseController {
// in the process of being called, so we don't need to go further.
return;
}
- this.messagingSystem.unsubscribe('NetworkController:networkDidChange', listener);
+ try {
+ this.messagingSystem.unsubscribe('NetworkController:networkDidChange', listener);
+ } catch (error) {
+ if (
+ typeof error === 'object' &&
+ error !== null &&
+ 'message' in error &&
+ error.message === 'Subscription not found for event: NetworkController:networkDidChange'
+ ) {
+ // The controller may have been destroyed, so don't worry about it
+ } else {
+ throw error;
+ }
+ }
this.update((state) => {
const meta = state.networksMetadata[state.selectedNetworkClientId];
meta.status = updatedNetworkStatus;
109 changes: 69 additions & 40 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4521,10 +4521,10 @@
resolved "https://registry.yarnpkg.com/@metamask/eslint-plugin-design-tokens/-/eslint-plugin-design-tokens-1.1.0.tgz#c9d4471f04f62bfb307aa261d11b7a674eb27961"
integrity sha512-33BJTEl96wXrkNdydNgTnfz3C0XP6/FdYbKzNnM8wT3XeVOkF/EOt8oiY8X4stXlNKDJtKyQchxENgZwS8sl9w==

"@metamask/eth-block-tracker@^11.0.1", "@metamask/eth-block-tracker@^11.0.2":
version "11.0.2"
resolved "https://registry.yarnpkg.com/@metamask/eth-block-tracker/-/eth-block-tracker-11.0.2.tgz#7890a4430bd6a92577585a66d7958771bfd88ec8"
integrity sha512-R1J3n2WY3PyEfYELc45MVFw7+6iKu7O3S/nBU0icmM3Q2mVqDMpctF5Z5pAZDYYEW35h7tTU2KJfUb1DrXzWcg==
"@metamask/eth-block-tracker@^11.0.3":
version "11.0.3"
resolved "https://registry.yarnpkg.com/@metamask/eth-block-tracker/-/eth-block-tracker-11.0.3.tgz#0e70aaa63f90c2fb18a308a9d67ca750641cde28"
integrity sha512-Lvm6oZcL5vRGnyulFVde5kbS5/IQ2hwmolYUiyZVqTPQGoKX5AdGAIJvAwXnXVgMMhNw177tYu//jBy78M13hA==
dependencies:
"@metamask/eth-json-rpc-provider" "^4.1.5"
"@metamask/safe-event-emitter" "^3.1.1"
Expand Down Expand Up @@ -4591,12 +4591,12 @@
pify "^3.0.0"
safe-stable-stringify "^2.3.2"

"@metamask/eth-json-rpc-middleware@^15.0.0":
version "15.0.0"
resolved "https://registry.yarnpkg.com/@metamask/eth-json-rpc-middleware/-/eth-json-rpc-middleware-15.0.0.tgz#167288ad4618438af9d1bda75d238cb0facfde3f"
integrity sha512-RkmaPQPWGH1qggaq0sStwVIeamiJOjf/2jBJfbX78r/nDCai8ddY/zHpATJr42SvtRYD0JrCPjo6v356IDzjQw==
"@metamask/eth-json-rpc-middleware@^15.0.1":
version "15.0.1"
resolved "https://registry.yarnpkg.com/@metamask/eth-json-rpc-middleware/-/eth-json-rpc-middleware-15.0.1.tgz#65a4382bdf87fa6c84fe9dc97a4d9c40b47bcbcb"
integrity sha512-AstO4eE6HmAn81pYyTeCIiFGYKJIRY2x7dWENF/IBkxYrf7eg90mFr1zjldZiacMeEMnkgzd9/tipanWGXT+wA==
dependencies:
"@metamask/eth-block-tracker" "^11.0.1"
"@metamask/eth-block-tracker" "^11.0.3"
"@metamask/eth-json-rpc-provider" "^4.1.5"
"@metamask/eth-sig-util" "^7.0.3"
"@metamask/json-rpc-engine" "^10.0.0"
Expand Down Expand Up @@ -4883,10 +4883,20 @@
uuid "^9.0.1"
webextension-polyfill "^0.12.0"

"@metamask/keyring-controller@^19.0.1":
version "19.0.1"
resolved "https://registry.yarnpkg.com/@metamask/keyring-controller/-/keyring-controller-19.0.1.tgz#6fee40a46a780a720f4c864ea779673569be06a7"
integrity sha512-6dNQBaJanAKEg7V0ksnWyqxHY1r3YCe910OF6DpnN97NZIPx3tba2zy32jbQWGPG6XaybfTG1xdUBtdYdeTpQA==
"@metamask/keyring-api@^12.0.0":
version "12.0.0"
resolved "https://registry.yarnpkg.com/@metamask/keyring-api/-/keyring-api-12.0.0.tgz#c36d2dfeeb175c69ba8b8a670a452724b3c5e51b"
integrity sha512-Dw5p5fYeA9AOoC+9gYaDv+xsh7sPm24mzDEiHzl8xmxsjS7uvhA41aDr36IRL1/HOoI1C8lLfExx5DVPFOGo9w==
dependencies:
"@metamask/keyring-utils" "^1.0.0"
"@metamask/superstruct" "^3.1.0"
"@metamask/utils" "^9.3.0"
bech32 "^2.0.0"

"@metamask/keyring-controller@^19.0.1", "@metamask/keyring-controller@^19.0.2":
version "19.0.2"
resolved "https://registry.yarnpkg.com/@metamask/keyring-controller/-/keyring-controller-19.0.2.tgz#e929a7816dfc1cd4de9222f63b83f064b0149c2d"
integrity sha512-w8H7z/+3TlnHq/6IkxzyEYNqbItwe2wMRufZ7kNLIRNCOGGJ1o+XoQB40aUYH9YH+YOb8ptn0ezzSK4G89fq0g==
dependencies:
"@ethereumjs/util" "^8.1.0"
"@keystonehq/metamask-airgapped-keyring" "^0.14.1"
Expand All @@ -4895,13 +4905,32 @@
"@metamask/eth-hd-keyring" "^7.0.4"
"@metamask/eth-sig-util" "^8.0.0"
"@metamask/eth-simple-keyring" "^6.0.5"
"@metamask/keyring-api" "^10.1.0"
"@metamask/message-manager" "^11.0.2"
"@metamask/keyring-api" "^12.0.0"
"@metamask/keyring-internal-api" "^1.0.0"
"@metamask/message-manager" "^11.0.3"
"@metamask/utils" "^10.0.0"
async-mutex "^0.5.0"
ethereumjs-wallet "^1.0.1"
immer "^9.0.6"

"@metamask/keyring-internal-api@^1.0.0":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@metamask/keyring-internal-api/-/keyring-internal-api-1.0.0.tgz#589ead606e5081b5d3298eda4792aa7adf33e888"
integrity sha512-4CZ3EV2JoFgLwcGNGC36jk8MTTSDkmqe/gnvYzQ4yRKrtvj094eXbL9abHgisgP6W7c5DNb9bP3i2jWFMmJnlA==
dependencies:
"@metamask/keyring-api" "^12.0.0"
"@metamask/keyring-utils" "^1.0.0"
"@metamask/superstruct" "^3.1.0"
"@metamask/utils" "^9.3.0"

"@metamask/keyring-utils@^1.0.0":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@metamask/keyring-utils/-/keyring-utils-1.0.0.tgz#06a5df63c57304811ec56ac6e250c4628da435b8"
integrity sha512-adxVCKPHnai4w1+ZUNwL0T2DfxMpjcQucMKfa74oQuxoqjbTBDKeW6FzJwRzFspYEuRMhOLFOMUuZQQMgyF1OQ==
dependencies:
"@metamask/superstruct" "^3.1.0"
"@metamask/utils" "^9.3.0"

"@metamask/logging-controller@^6.0.1":
version "6.0.1"
resolved "https://registry.yarnpkg.com/@metamask/logging-controller/-/logging-controller-6.0.1.tgz#cfe858e91ba6fa490ebcf4e50bebd5f6dee0417e"
Expand All @@ -4911,17 +4940,17 @@
"@metamask/controller-utils" "^11.3.0"
uuid "^8.3.2"

"@metamask/message-manager@^11.0.2":
version "11.0.2"
resolved "https://registry.yarnpkg.com/@metamask/message-manager/-/message-manager-11.0.2.tgz#805ac8d2184c56d973a787bdc7c9571024348ce6"
integrity sha512-j8DgWn7ACfwZtLFqeAYx4U/TquBEtcPYa81LjhoZYK39W/MQVr4ZKAmGEKxKRruMLz50GX7ciOEZU9SBtPBAog==
"@metamask/message-manager@^11.0.3":
version "11.0.3"
resolved "https://registry.yarnpkg.com/@metamask/message-manager/-/message-manager-11.0.3.tgz#7fc1a41566d7611dc99124b66dcbc29a0dc58efc"
integrity sha512-y3AnzPQvzAE6GWytmdfftp5vr1LepA3L02iFS4PFj0Xk+t1d42IjPAdd7XC/wWFJ+tGasrSDW6T0PKXoItCqEA==
dependencies:
"@metamask/base-controller" "^7.0.2"
"@metamask/controller-utils" "^11.4.4"
"@metamask/eth-sig-util" "^8.0.0"
"@metamask/utils" "^10.0.0"
"@types/uuid" "^8.3.0"
jsonschema "^1.2.4"
jsonschema "^1.4.1"
uuid "^8.3.2"

"@metamask/message-signing-snap@^0.3.3":
Expand All @@ -4947,21 +4976,21 @@
resolved "https://registry.yarnpkg.com/@metamask/mobile-provider/-/mobile-provider-3.0.0.tgz#8a6a5a0874c8cbe4b468f63dfc57117d207f9595"
integrity sha512-XwFJk0rd9lAZR5xS3VC7ypEhD7DvZR2gi2Ch6PHnODIqeS9Te3OdVKK5+jHI4his8v/zs6LWdFdlRtx5/jL96w==

"@metamask/network-controller@^22.1.0":
version "22.1.0"
resolved "https://registry.yarnpkg.com/@metamask/network-controller/-/network-controller-22.1.0.tgz#b4c81a31fc52147d12131bfb16c77c1c1cfbe43c"
integrity sha512-wvP2HUBQCWvlvBkuhqMNtd6+D/cJa343ABFLfCLNrQsk8QjdHPFw/QDIqC+QXTPxyrPWw9GL5akaLb//rmO1NA==
"@metamask/network-controller@^22.1.0", "@metamask/network-controller@^22.1.1":
version "22.1.1"
resolved "https://registry.yarnpkg.com/@metamask/network-controller/-/network-controller-22.1.1.tgz#6c3b5aef07ae66ae4cec44a62dbbd7df4421f971"
integrity sha512-NTIZjRuPqOynPfPDqy/tPc8ZeKnD2ys8i2ihxq1ODHwSAHBwQ0gogNHBda7PMLaKjuuPkfmh2EzkALiH07MKSg==
dependencies:
"@metamask/base-controller" "^7.0.2"
"@metamask/controller-utils" "^11.4.4"
"@metamask/eth-block-tracker" "^11.0.2"
"@metamask/eth-block-tracker" "^11.0.3"
"@metamask/eth-json-rpc-infura" "^10.0.0"
"@metamask/eth-json-rpc-middleware" "^15.0.0"
"@metamask/eth-json-rpc-middleware" "^15.0.1"
"@metamask/eth-json-rpc-provider" "^4.1.6"
"@metamask/eth-query" "^4.0.0"
"@metamask/json-rpc-engine" "^10.0.1"
"@metamask/rpc-errors" "^7.0.1"
"@metamask/swappable-obj-proxy" "^2.2.0"
"@metamask/swappable-obj-proxy" "^2.3.0"
"@metamask/utils" "^10.0.0"
async-mutex "^0.5.0"
fast-deep-equal "^3.1.3"
Expand Down Expand Up @@ -5105,15 +5134,15 @@
"@metamask/base-controller" "^7.0.2"
"@metamask/controller-utils" "^11.4.4"

"@metamask/profile-sync-controller@^3.0.0":
version "3.0.0"
resolved "https://registry.yarnpkg.com/@metamask/profile-sync-controller/-/profile-sync-controller-3.0.0.tgz#52cdb1f370ba6c8ce580fb9f9d1e9a5b1f8b9014"
integrity sha512-OlNOlWcHLlX4QNKR/J0O4IwgtO46EYA3OPzntmDk7zlFtd3I61qooE3EnRWH6aYPQsf7GcsM2aP44cKVJyV4mg==
"@metamask/profile-sync-controller@npm:@metamask-previews/[email protected]":
version "3.1.1-preview-e218ba33"
resolved "https://registry.yarnpkg.com/@metamask-previews/profile-sync-controller/-/profile-sync-controller-3.1.1-preview-e218ba33.tgz#87d65c3130d41d60208965486d0c4a895b46c2be"
integrity sha512-dUtKY3XJSrrs6zd0xqkVJeuYpB7CZVqkPUhBxHwrzxc27XVvccpmQiFtxyAQO4LRfpAL134nP1nneOa2rKSZ4A==
dependencies:
"@metamask/base-controller" "^7.0.2"
"@metamask/keyring-api" "^10.1.0"
"@metamask/keyring-controller" "^19.0.1"
"@metamask/network-controller" "^22.1.0"
"@metamask/keyring-api" "^12.0.0"
"@metamask/keyring-controller" "^19.0.2"
"@metamask/network-controller" "^22.1.1"
"@metamask/snaps-sdk" "^6.7.0"
"@metamask/snaps-utils" "^8.3.0"
"@noble/ciphers" "^0.5.2"
Expand Down Expand Up @@ -5419,10 +5448,10 @@
resolved "https://registry.yarnpkg.com/@metamask/superstruct/-/superstruct-3.1.0.tgz#148f786a674fba3ac885c1093ab718515bf7f648"
integrity sha512-N08M56HdOgBfRKkrgCMZvQppkZGcArEop3kixNEtVbJKm6P9Cfg0YkI6X0s1g78sNrj2fWUwvJADdZuzJgFttA==

"@metamask/swappable-obj-proxy@^2.1.0", "@metamask/swappable-obj-proxy@^2.2.0":
version "2.2.0"
resolved "https://registry.yarnpkg.com/@metamask/swappable-obj-proxy/-/swappable-obj-proxy-2.2.0.tgz#31b8e0ce57e28bf9847b3b24b214996f7748cc99"
integrity sha512-0OjVwQtrrPFRGipw64yDUQA0CUXCK161LWCv2KlTTDZD8BKeWSNb0gbnpDI7HvhsJ0gki5gScZj1hF3ShDnBzA==
"@metamask/swappable-obj-proxy@^2.1.0", "@metamask/swappable-obj-proxy@^2.2.0", "@metamask/swappable-obj-proxy@^2.3.0":
version "2.3.0"
resolved "https://registry.yarnpkg.com/@metamask/swappable-obj-proxy/-/swappable-obj-proxy-2.3.0.tgz#276819d24f1b411c768441efb6098c1743d6f67a"
integrity sha512-+VFE6wVWve86SLiUI3jyhJjizUezpOnwvRyem7EP79Mml+oSm48gQ4W8QqeQqTugbrlCsxtFI4QNEPotQsll6Q==

"@metamask/swaps-controller@^11.0.0":
version "11.0.0"
Expand Down Expand Up @@ -5470,7 +5499,7 @@
lodash "^4.17.21"
uuid "^8.3.2"

"@metamask/utils@^10.0.0", "@metamask/utils@^10.0.1", "@metamask/utils@^3.4.1", "@metamask/utils@^5.0.1", "@metamask/utils@^5.0.2", "@metamask/utils@^8.2.0", "@metamask/utils@^8.3.0", "@metamask/utils@^9.0.0", "@metamask/utils@^9.1.0", "@metamask/utils@^9.2.1":
"@metamask/utils@^10.0.0", "@metamask/utils@^10.0.1", "@metamask/utils@^3.4.1", "@metamask/utils@^5.0.1", "@metamask/utils@^5.0.2", "@metamask/utils@^8.2.0", "@metamask/utils@^8.3.0", "@metamask/utils@^9.0.0", "@metamask/utils@^9.1.0", "@metamask/utils@^9.2.1", "@metamask/utils@^9.3.0":
version "10.0.1"
resolved "https://registry.yarnpkg.com/@metamask/utils/-/utils-10.0.1.tgz#a765f96c20e35fc51c068fb9f88a3332b40b215e"
integrity sha512-zHgAitJtRwviVVFnRUA2PLRMaAwatr3jiHgiH7mPicJaeSK4ma01aGR4fHy0iy5tlVo1ZiioTmJ1Hbp8FZ6pSg==
Expand Down Expand Up @@ -20542,7 +20571,7 @@ jsonpath-plus@^7.2.0:
resolved "https://registry.yarnpkg.com/jsonpath-plus/-/jsonpath-plus-7.2.0.tgz#7ad94e147b3ed42f7939c315d2b9ce490c5a3899"
integrity sha512-zBfiUPM5nD0YZSBT/o/fbCUlCcepMIdP0CJZxM1+KgA4f2T206f6VAg9e7mX35+KlMaIc5qXW34f3BnwJ3w+RA==

jsonschema@^1.2.4, jsonschema@^1.4.1:
jsonschema@^1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/jsonschema/-/jsonschema-1.4.1.tgz#cc4c3f0077fb4542982973d8a083b6b34f482dab"
integrity sha512-S6cATIPVv1z0IlxdN+zUk5EPjkGCdnhN4wVSBlvoUO1tOLJootbo9CquNJmbIh4yikWHiUedhRYrNPn1arpEmQ==
Expand Down
Loading