@metamask/snaps-controllers 3.5.0 → 3.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [3.5.1]
10
+ ### Changed
11
+ - Improve `SnapController` constructor types ([#2023](https://github.com/MetaMask/snaps/pull/2023))
12
+ - Bump `snaps-registry` ([#2020](https://github.com/MetaMask/snaps/pull/2020))
13
+
9
14
  ## [3.5.0]
10
15
  ### Changed
11
16
  - Reduce memory usage by removing source code and state from runtime ([#2009](https://github.com/MetaMask/snaps/pull/2009))
@@ -136,7 +141,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
136
141
  - The version of the package no longer needs to match the version of all other
137
142
  MetaMask Snaps packages.
138
143
 
139
- [Unreleased]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-controllers@3.5.0...HEAD
144
+ [Unreleased]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-controllers@3.5.1...HEAD
145
+ [3.5.1]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-controllers@3.5.0...@metamask/snaps-controllers@3.5.1
140
146
  [3.5.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-controllers@3.4.1...@metamask/snaps-controllers@3.5.0
141
147
  [3.4.1]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-controllers@3.4.0...@metamask/snaps-controllers@3.4.1
142
148
  [3.4.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-controllers@3.3.0...@metamask/snaps-controllers@3.4.0
@@ -327,7 +327,7 @@ class SnapController extends _basecontroller.BaseController {
327
327
  runtime.pendingOutboundRequests = 0;
328
328
  try {
329
329
  if (this.isRunning(snapId)) {
330
- _class_private_field_get(this, _closeAllConnections).call(this, snapId);
330
+ _class_private_field_get(this, _closeAllConnections)?.call(this, snapId);
331
331
  await _class_private_method_get(this, _terminateSnap, terminateSnap).call(this, snapId);
332
332
  }
333
333
  } finally{
@@ -460,9 +460,11 @@ class SnapController extends _basecontroller.BaseController {
460
460
  * handlers, event listeners, and permissions; tear down all snap providers.
461
461
  */ async clearState() {
462
462
  const snapIds = Object.keys(this.state.snaps);
463
- snapIds.forEach((snapId)=>{
464
- _class_private_field_get(this, _closeAllConnections).call(this, snapId);
465
- });
463
+ if (_class_private_field_get(this, _closeAllConnections)) {
464
+ snapIds.forEach((snapId)=>{
465
+ _class_private_field_get(this, _closeAllConnections)?.call(this, snapId);
466
+ });
467
+ }
466
468
  await this.messagingSystem.call('ExecutionService:terminateAllSnaps');
467
469
  snapIds.forEach((snapId)=>_class_private_method_get(this, _revokeAllSnapPermissions, revokeAllSnapPermissions).call(this, snapId));
468
470
  this.update((state)=>{