Commit 5426bc0
authored
fix: Prevent initial connections from being revoked as unused (#3729)
Fixes an issue where initial connections between Snaps could be
considered unused when updating preinstalled Snaps. The fix is to treat
`wallet_snap` as a dynamic permission, it should probably have been
marked as one in the past when `wallet_requestSnaps` was 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.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Adds `wallet_snap` to dynamic permissions to prevent revoking initial
connections and introduces a test for two-way preinstalled snap
connections.
>
> - **Controller**:
> - Add `wallet_snap` to default `dynamicPermissions` in
`SnapController` constructor to prevent unintended revocation of initial
connections.
> - **Tests**:
> - Add test ensuring preinstalled snaps with two-way
`initialConnections` do not trigger
`PermissionController:revokePermissions` for `wallet_snap`.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
3435d5c. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 82156c7 commit 5426bc0
File tree
2 files changed
+93
-1
lines changed- packages/snaps-controllers/src/snaps
2 files changed
+93
-1
lines changedLines changed: 88 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6087 | 6087 | | |
6088 | 6088 | | |
6089 | 6089 | | |
| 6090 | + | |
| 6091 | + | |
| 6092 | + | |
| 6093 | + | |
| 6094 | + | |
| 6095 | + | |
| 6096 | + | |
| 6097 | + | |
| 6098 | + | |
| 6099 | + | |
| 6100 | + | |
| 6101 | + | |
| 6102 | + | |
| 6103 | + | |
| 6104 | + | |
| 6105 | + | |
| 6106 | + | |
| 6107 | + | |
| 6108 | + | |
| 6109 | + | |
| 6110 | + | |
| 6111 | + | |
| 6112 | + | |
| 6113 | + | |
| 6114 | + | |
| 6115 | + | |
| 6116 | + | |
| 6117 | + | |
| 6118 | + | |
| 6119 | + | |
| 6120 | + | |
| 6121 | + | |
| 6122 | + | |
| 6123 | + | |
| 6124 | + | |
| 6125 | + | |
| 6126 | + | |
| 6127 | + | |
| 6128 | + | |
| 6129 | + | |
| 6130 | + | |
| 6131 | + | |
| 6132 | + | |
| 6133 | + | |
| 6134 | + | |
| 6135 | + | |
| 6136 | + | |
| 6137 | + | |
| 6138 | + | |
| 6139 | + | |
| 6140 | + | |
| 6141 | + | |
| 6142 | + | |
| 6143 | + | |
| 6144 | + | |
| 6145 | + | |
| 6146 | + | |
| 6147 | + | |
| 6148 | + | |
| 6149 | + | |
| 6150 | + | |
| 6151 | + | |
| 6152 | + | |
| 6153 | + | |
| 6154 | + | |
| 6155 | + | |
| 6156 | + | |
| 6157 | + | |
| 6158 | + | |
| 6159 | + | |
| 6160 | + | |
| 6161 | + | |
| 6162 | + | |
| 6163 | + | |
| 6164 | + | |
| 6165 | + | |
| 6166 | + | |
| 6167 | + | |
| 6168 | + | |
| 6169 | + | |
| 6170 | + | |
| 6171 | + | |
| 6172 | + | |
| 6173 | + | |
| 6174 | + | |
| 6175 | + | |
| 6176 | + | |
| 6177 | + | |
6090 | 6178 | | |
6091 | 6179 | | |
6092 | 6180 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
936 | 936 | | |
937 | 937 | | |
938 | 938 | | |
939 | | - | |
| 939 | + | |
940 | 940 | | |
941 | 941 | | |
942 | 942 | | |
| |||
4305 | 4305 | | |
4306 | 4306 | | |
4307 | 4307 | | |
| 4308 | + | |
| 4309 | + | |
| 4310 | + | |
| 4311 | + | |
4308 | 4312 | | |
4309 | 4313 | | |
4310 | 4314 | | |
| |||
0 commit comments