What does it mean to track a channel that doesn't exist?

Best explained with an example:

$ sudo snap install test-beta-only --beta
$ snap switch test-beta-only --stable 
$ snap info test-beta-only
name:      test-beta-only
summary:   Test snap only available in beta channel
publisher: robert-ancell
description: |
  Test snap only available in beta channel.
snap-id:     5rsE0uymDxjOnjfMxynJPHbNjYrBsBau
tracking:    stable
installed:   1 (1) 4kB -
refreshed:   2018-02-13 11:41:46 +1300 NZDT
channels:          
  stable:    –         
  candidate: –         
  beta:      1 (1) 4kB -
  edge:      ↑         

There is no stable version but we’re tracking the stable channel - is that an error that should be caught? What version would I expect it to update to?

I’d expect you to not get an update until the publisher pushes a revision to the stable channel. However, I can understand how this might be confusing to users, so perhaps we should consider improving the UX for this case.

I came across this when working on channels support in GNOME Software. We provide effectively a combo box to choose channels and I was looking how we should handle beta only snaps. The two questions I’m pondering are:

  • Should a user only be given the beta/edge option or stable/candidate/beta/edge?
  • What should GNOME Software do if it finds a snap tracking a channel that isn’t available. This is the above case or even the following is valid:
$ snap switch test-beta-only --channel=foo

The stable channel does exist in this case, but we say it is closed at the moment, which means we need to fallback to a channel of more conservative risk. Since stable is the most conservative risk, it’s okay to not show the channel if it is closed or we’ll need to fail if an install is attempted, because there’s really nothing we can do to satisfy the request that wouldn’t put the user into unexpected territory. That said, if only the candidate channel was closed but there was a stable version, installing candidate would still work because snapd picks up the snap from the stable channel.

It’s simpler to think about it in terms of tolerance. When people say “I’m happy to take the release candidate”, they are also happy to take the final stable version once it does come out, rather than being stuck on an old release candidate forever.

The channels documentation has more details about all of that: