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

fix: instantiate preinstalled snaps on cleanup #2393

Merged
merged 5 commits into from
May 7, 2024

Conversation

Prithpal-Sooriya
Copy link
Contributor

@Prithpal-Sooriya Prithpal-Sooriya commented May 3, 2024

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"

preinstalled snaps probably should not be cleaned up, so this ensures they are saved and have the correct permissions
matteoscurati
matteoscurati previously approved these changes May 4, 2024
Copy link
Contributor

@matteoscurati matteoscurati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>
Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>
matteoscurati
matteoscurati previously approved these changes May 7, 2024
Copy link
Contributor

@matteoscurati matteoscurati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok!

@FrederikBolding FrederikBolding merged commit c702186 into main May 7, 2024
151 checks passed
@FrederikBolding FrederikBolding deleted the fix-preinstalled-snaps-cleanup branch May 7, 2024 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants