MetaMask / snaps

Extend the functionality of MetaMask using Snaps
https://metamask.io/snaps/
Other
711 stars 546 forks source link

fix: instantiate preinstalled snaps on cleanup #2393

Closed Prithpal-Sooriya closed 1 month ago

Prithpal-Sooriya commented 2 months ago

Preinstalled snaps should not be cleaned up. This ensures they are saved and have the correct permissions when a cleanup is performed.

This comes from testing with Extensions PreInstalled snaps. As a user is setting up a new wallet, the SnapController will have its state cleared. https://github.com/MetaMask/metamask-extension/blob/develop/app/scripts/metamask-controller.js#L3780

Due to this, any Snap calls made using preinstalled snaps will fail with: Snap "npm:<SNAP_ID>" is not permitted to use "endowment:rpc"