Skip to content

Add Snap installation events - #162

Merged
rekmarks merged 2 commits into
mainfrom
snap-installation-events
Dec 15, 2021
Merged

rekmarks merged 2 commits into
mainfrom
snap-installation-events

Conversation

@rekmarks

@rekmarks rekmarks commented Dec 15, 2021 •

Copy link
Copy Markdown
Contributor

This PR adds installation-related ControllerMessenger events to the SnapController, fixes a bug in installSnaps, makes some methods private, and deletes runExistingSnaps.

The following events are added:

  • snapAdded, emitted when a Snap has been added to state and its status is installing
    • We will leverage this event to record metadata about the Snap in the extension.
  • snapInstalled, emitted when a Snap has been fully installed
  • snapRemoved, emitted when a Snap is removed

A bug was introduced in #140, where a successfully installed Snap would be overwritten with an unrelated error in the installSnaps result object. This PR prevents this overwrite from happening.

The authorize and processRequestedSnap methods are made private, since they should never be called by third parties. In truth, add should also be private, but we currently rely on it for the majority of our tests, and will attend to it later.

Finally, the runExistingSnaps method is removed because it's a hangover from the old Snaps lifecycle.

@rekmarks
rekmarks requested a review from shanejonas December 15, 2021 08:46
@rekmarks
rekmarks force-pushed the snap-installation-events branch from 771c0ff to 1bc4dcf Compare December 15, 2021 08:46
@rekmarks
rekmarks merged commit 2c6b286 into main Dec 15, 2021
@rekmarks
rekmarks deleted the snap-installation-events branch December 15, 2021 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants