fix: Omit installing Snaps from getAllSnaps and getRunnableSnaps#3990
Merged
FrederikBolding merged 2 commits intomainfrom May 8, 2026
Merged
fix: Omit installing Snaps from getAllSnaps and getRunnableSnaps#3990FrederikBolding merged 2 commits intomainfrom
getAllSnaps and getRunnableSnaps#3990FrederikBolding merged 2 commits intomainfrom
Conversation
Mrtenz
reviewed
May 8, 2026
| return getRunnableSnaps( | ||
| Object.values(this.state.snaps) | ||
| .filter((snap) => snap.status !== SnapStatus.Installing) | ||
| .map(truncateSnap), |
Member
There was a problem hiding this comment.
Did getAllSnaps do this previously?
Member
Author
There was a problem hiding this comment.
I don't think so, but I wonder if it should. #3990 (comment)
FrederikBolding
commented
May 8, 2026
| */ | ||
| getRunnableSnaps(): TruncatedSnap[] { | ||
| return getRunnableSnaps(this.getAllSnaps()); | ||
| return getRunnableSnaps( |
Member
Author
There was a problem hiding this comment.
We could also modify getAllSnaps to filter out installing Snaps. The JSDoc seems to imply that only installed Snaps should be included. WDYT @Mrtenz ?
Member
There was a problem hiding this comment.
Makes sense to me, I can't think of a good reason to get a Snap that isn't installed yet.
getRunnableSnapsgetAllSnaps and getRunnableSnaps
Mrtenz
approved these changes
May 8, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3990 +/- ##
=======================================
Coverage 98.56% 98.56%
=======================================
Files 429 429
Lines 12365 12366 +1
Branches 1944 1944
=======================================
+ Hits 12187 12188 +1
Misses 178 178 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Omit Snaps in the
installingstate from being returned bygetAllSnapsandgetRunnableSnaps. Since they aren't actually runnable.In the clients this caused a bug where consumers of Snaps would fail to get valid permissions from
PermissionControllerbecause the installation had not completed.Note
Low Risk
Low risk change that only filters out
SnapStatus.Installingentries fromgetAllSnaps, narrowing what downstream callers (includinggetRunnableSnaps) can see; main risk is any consumer that expected installing snaps to be listed.Overview
SnapController.getAllSnaps()now omits Snaps inSnapStatus.Installing, so they are no longer returned in the truncated Snap list.Because
getRunnableSnaps()is derived fromgetAllSnaps(), installing Snaps will also no longer be considered runnable, avoiding clients interacting with Snaps before installation (and permissions) are complete.Reviewed by Cursor Bugbot for commit ba0faa0. Bugbot is set up for automated code reviews on this repo. Configure here.