Skip to content

Commit ccf10b2

Browse files
fix: Override disableSnapInstallation feature flag when using automatic updates (#3735)
Allow updates of Snaps even when the `disableSnapInstallation` feature flag is enabled as long as the update is an automatic one. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Permits automatic Snap updates to bypass the `disableSnapInstallation` check while preserving manual update restrictions for preinstalled Snaps. > > - **Snaps Controller** (`SnapController.ts`): > - Modify `#updateSnap(...)` to only call `#assertCanInstallSnaps()` when `automaticUpdate` is false, allowing automatic updates even if `disableSnapInstallation` is enabled. > - Retain restriction preventing manual updates of preinstalled Snaps (`preinstalled && !automaticUpdate`). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 4c35eb4. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent e081eb2 commit ccf10b2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/snaps-controllers/src/snaps/SnapController.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2913,7 +2913,9 @@ export class SnapController extends BaseController<
29132913
versionRange: SemVerRange;
29142914
automaticUpdate?: boolean;
29152915
}): Promise<TruncatedSnap> {
2916-
this.#assertCanInstallSnaps();
2916+
if (!automaticUpdate) {
2917+
this.#assertCanInstallSnaps();
2918+
}
29172919
this.#assertCanUsePlatform();
29182920

29192921
const snap = this.getExpect(snapId);

0 commit comments

Comments
 (0)