fix: Prevent initial connections from being revoked as unused #3729
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes an issue where initial connections between Snaps could be considered unused when updating preinstalled Snaps. The fix is to treat
wallet_snapas a dynamic permission, it should probably have been marked as one in the past whenwallet_requestSnapswas unblocked since that allows dynamically adding to the permission.This in combination with a previous commit effectively means that any permissions granted in the manifest that are considered dynamic, will not be automatically revoked when the permission is removed from the manifest. This is intentional, but not ideal.
Note
Adds
wallet_snapto dynamic permissions to prevent revoking initial connections and introduces a test for two-way preinstalled snap connections.wallet_snapto defaultdynamicPermissionsinSnapControllerconstructor to prevent unintended revocation of initial connections.initialConnectionsdo not triggerPermissionController:revokePermissionsforwallet_snap.Written by Cursor Bugbot for commit 3435d5c. This will update automatically on new commits. Configure here.