Content snaps as additional content?

I would like to use content snaps as additional installable content related to snap. Like themes, plugins and game maps. However they are not designed for this purpose. Their current usage is mostly runtime environments and are designed with that in mind. From what I understand content snaps are:

  1. Mandatory download with snap which uses them and users don’t get to chose when they are installed
  2. Never updated to prevent breaking snap, unless tricked into updating by changing entry-points (discussed here)

These 2 points prevents content snaps from being used in way that would allow users to get additional functionality when they so chose and developers to separate release and additional community content for users to easily install.

snap install app app-community-themes

This is not true, automatic downloads of content snaps only happens when a snap specifies default-provider, if a snap does not specify default-provider then no snap is automatically installed to fill that content plug. But note that if a user already has a suitable provider for the content interface slot installed, and auto-connect rules are setup/followed correctly, then the using snap will auto-connect to the already installed providing slot without issue.

This is also a misunderstanding, it is not that content snaps are never updated, it’s just that they are not subject to a different update cycle than other snaps. What this means is that if your app snap has a pending refresh available and the content providing snap has a pending refresh available, then it’s not deterministic which order those refreshes will happen, but absent refresh control (or something like refresh app awareness) in a few hours/days both snaps will be refreshed automatically. If a user knows that they do not have the most up to date version of either snap, they can manually trigger refreshes for either (or both) snaps with snap refresh <the-snap>.

Users still get to choose when they get new functionality, they can control at what time the automatic refresh happens, and they can manually trigger refreshes to get new functionality.

2 Likes

Ian Johnson via snapcraft.io writes:

This is not true, automatic downloads of content snaps only happens when a snap specifies default-provider, if a snap does not specify default-provider then no snap is automatically installed to fill that content plug. But note that if a user already has a suitable provider for the content interface slot installed, and auto-connect rules are setup/followed correctly, then the using snap will auto-connect to the already installed providing slot without issue.

I just want to add that there is one more scenario where this does not
happen. There is a scenario where a default-provider is set for a snap
but the slot is satisfied by another snap, hence satisfying the
interface requirement.

Not a feature that is widely used or exposed, nonetheless, very useful
from an interface point of view.

2 Likes

Thanks for clearing these 2 points and content snaps in general for me.

snap does not specify default-provider then no snap is automatically installed

Usage of default-provider and what it means for triggering download of content snap wasn’t clear to me. I see it now in documentation.

in a few hours/days both snaps will be refreshed automatically

In this use case it doesn’t matter when content snap refreshes as long as it does eventually. That wasn’t clear from mentioned discussion (also very hard to summarize entire discussion in one sentence).

So it is currently possible for users to install snap and have a ability to add/remove additional content when they want it (with some wrapper magic checking presence of content snap) while all snaps refresh irrespective of each other.

but the slot is satisfied by another snap

For this use case it would be interesting to explore other content snaps providing for example their own set of themes, plugins or game maps.