Skip to content

Commit

Permalink
Fix invalid state persistence error (#20080)
Browse files Browse the repository at this point in the history
* Fix invalid state persistence error

We have been seeing Sentry errors showing that state persistence has
been failing for some users that have invalid `NetworkController`
state. This has been fixed by updating to
`@metamask/base-controller@v3.2.0`, which is more tolerant of
unexpected state properties.

* Update LavaMoat policies

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
  • Loading branch information
Gudahtt and metamaskbot authored Jul 18, 2023
1 parent 8f8613a commit fe3e960
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 11 deletions.
4 changes: 4 additions & 0 deletions lavamoat/browserify/beta/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -1535,6 +1535,7 @@
"TextEncoder": true
},
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
Expand Down Expand Up @@ -1777,6 +1778,7 @@
"TextEncoder": true
},
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
Expand Down Expand Up @@ -1879,6 +1881,7 @@
"TextEncoder": true
},
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
Expand Down Expand Up @@ -1914,6 +1917,7 @@
"TextEncoder": true
},
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
Expand Down
8 changes: 8 additions & 0 deletions lavamoat/browserify/desktop/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -1282,6 +1282,7 @@
"TextEncoder": true
},
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
Expand All @@ -1299,6 +1300,7 @@
"TextEncoder": true
},
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
Expand Down Expand Up @@ -1661,6 +1663,7 @@
"TextEncoder": true
},
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
Expand Down Expand Up @@ -1999,6 +2002,7 @@
"TextEncoder": true
},
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
Expand Down Expand Up @@ -2164,6 +2168,7 @@
"TextEncoder": true
},
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
Expand Down Expand Up @@ -2333,6 +2338,7 @@
"TextEncoder": true
},
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
Expand Down Expand Up @@ -2370,6 +2376,7 @@
"TextEncoder": true
},
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
Expand Down Expand Up @@ -2403,6 +2410,7 @@
"TextEncoder": true
},
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
Expand Down
8 changes: 8 additions & 0 deletions lavamoat/browserify/flask/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -1282,6 +1282,7 @@
"TextEncoder": true
},
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
Expand All @@ -1299,6 +1300,7 @@
"TextEncoder": true
},
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
Expand Down Expand Up @@ -1661,6 +1663,7 @@
"TextEncoder": true
},
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
Expand Down Expand Up @@ -1999,6 +2002,7 @@
"TextEncoder": true
},
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
Expand Down Expand Up @@ -2164,6 +2168,7 @@
"TextEncoder": true
},
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
Expand Down Expand Up @@ -2333,6 +2338,7 @@
"TextEncoder": true
},
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
Expand Down Expand Up @@ -2370,6 +2376,7 @@
"TextEncoder": true
},
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
Expand Down Expand Up @@ -2403,6 +2410,7 @@
"TextEncoder": true
},
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
Expand Down
4 changes: 4 additions & 0 deletions lavamoat/browserify/main/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -1535,6 +1535,7 @@
"TextEncoder": true
},
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
Expand Down Expand Up @@ -1777,6 +1778,7 @@
"TextEncoder": true
},
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
Expand Down Expand Up @@ -1879,6 +1881,7 @@
"TextEncoder": true
},
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
Expand Down Expand Up @@ -1914,6 +1917,7 @@
"TextEncoder": true
},
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
Expand Down
4 changes: 4 additions & 0 deletions lavamoat/browserify/mmi/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -1763,6 +1763,7 @@
"TextEncoder": true
},
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
Expand Down Expand Up @@ -2005,6 +2006,7 @@
"TextEncoder": true
},
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
Expand Down Expand Up @@ -2107,6 +2109,7 @@
"TextEncoder": true
},
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
Expand Down Expand Up @@ -2142,6 +2145,7 @@
"TextEncoder": true
},
"packages": {
"@metamask/key-tree>@noble/hashes": true,
"browserify>buffer": true,
"nock>debug": true,
"semver": true,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@
"@metamask/announcement-controller": "^4.0.0",
"@metamask/approval-controller": "^3.4.0",
"@metamask/assets-controllers": "^9.2.0",
"@metamask/base-controller": "^3.1.0",
"@metamask/base-controller": "^3.2.0",
"@metamask/browser-passworder": "^4.1.0",
"@metamask/contract-metadata": "^2.3.1",
"@metamask/controller-utils": "^4.2.0",
Expand Down
21 changes: 11 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3930,13 +3930,13 @@ __metadata:
languageName: node
linkType: hard

"@metamask/base-controller@npm:^3.0.0, @metamask/base-controller@npm:^3.1.0":
version: 3.1.0
resolution: "@metamask/base-controller@npm:3.1.0"
"@metamask/base-controller@npm:^3.0.0, @metamask/base-controller@npm:^3.1.0, @metamask/base-controller@npm:^3.2.0":
version: 3.2.0
resolution: "@metamask/base-controller@npm:3.2.0"
dependencies:
"@metamask/utils": ^5.0.2
"@metamask/utils": ^6.2.0
immer: ^9.0.6
checksum: fc1597a099e6d28bd089df936ca349d6c38c2e1b0f0737385cba30c34a5239241519eb172d77c70f8db2604f4dc5724f6893affe42bdd104cef98f9cfd6f1db8
checksum: 3be6f2594309c013e07f83c4bb8271e1e99f02b6ff829c18b5e7218fbab4e6a9e03bcb49056704ce47f84ae2f38b1bc1c10284ec538aad56ed7b554ef2d3e189
languageName: node
linkType: hard

Expand Down Expand Up @@ -5068,16 +5068,17 @@ __metadata:
languageName: node
linkType: hard

"@metamask/utils@npm:^6.0.0, @metamask/utils@npm:^6.0.1, @metamask/utils@npm:^6.1.0":
version: 6.1.0
resolution: "@metamask/utils@npm:6.1.0"
"@metamask/utils@npm:^6.0.0, @metamask/utils@npm:^6.0.1, @metamask/utils@npm:^6.1.0, @metamask/utils@npm:^6.2.0":
version: 6.2.0
resolution: "@metamask/utils@npm:6.2.0"
dependencies:
"@ethereumjs/tx": ^4.1.2
"@noble/hashes": ^1.3.1
"@types/debug": ^4.1.7
debug: ^4.3.4
semver: ^7.3.8
superstruct: ^1.0.3
checksum: d4eac3ce3c08674b8e9ef838d1661a5025690c6f266c26ebdb8e8d0da11fce786e54c326b5d9c6d33b262f37e7057e31d6545a3715613bd0a5bfa10e7755643a
checksum: 0bc675358ecc09b3bc04da613d73666295d7afa51ff6b8554801585966900b24b8545bd93b8b2e9a17db867ebe421fe884baf3558ec4ca3199fa65504f677c1b
languageName: node
linkType: hard

Expand Down Expand Up @@ -24191,7 +24192,7 @@ __metadata:
"@metamask/approval-controller": ^3.4.0
"@metamask/assets-controllers": ^9.2.0
"@metamask/auto-changelog": ^2.1.0
"@metamask/base-controller": ^3.1.0
"@metamask/base-controller": ^3.2.0
"@metamask/browser-passworder": ^4.1.0
"@metamask/contract-metadata": ^2.3.1
"@metamask/controller-utils": ^4.2.0
Expand Down

0 comments on commit fe3e960

Please sign in to comment.