Snap refresh UX issues

I just ran this:

➜  ~ snap refresh snapcraft --revision 2251 --amend --classic
error: local snap "snapcraft" is unknown to the store, use --amend to proceed anyway
➜  ~ snap refresh snapcraft --amend --classic                
snapcraft (edge) 3.8+git52.g89571007 from Canonical✓ refreshed
➜  ~ snap refresh snapcraft --revision 2251                  
snapcraft 3.0 from Canonical✓ refreshed

Issues I see:

  • Why does the first command tell me to amend when I passed in -amend?
  • Why is it that when I do not pass --revision on the second line I get edge instead of stable if I did not pass any flag? It mentioned downloading from edge while doing this.
  • In the last command, even though I passed a revision, it printed out that it was downloading from edge.

PS: It is really hard to capture these messages, is there a toggle to have each message printed on a single line?


  1. that’s a bug in flag handling. You probably shouldn’t be able to say --amend and --revision at the same time. @pedronis might disagree but if not I’ll just add a check for this.
  2. You must have had snapcraft installed and tracking edge before installing the local version you’re now amending to; in snap info snapcraft, even with the local version, you’d see tracking: edge.
  3. Again, what it reports is what you’re tracking. There are some corner case bugs in what is presented to the user, but the ones you’re looking at here are correct (even if surprising). If you think it is wrong, we can discuss why and how to fix it.
    The corner case bug is for example if you install something without it tracking a channel, and then amend, you get “Channel for some-snap is closed; temporarily forwarding to stable.” which is any vegetable.

Good explanations, my expectation for --revision is to pin, I guess that calling refresh would look into what I am tracking. The from I had with the messages is that it did not say it was going to be tracking edge but that it was installing from it.

Yeah, --revision explicitly does not pin.

If you need pinning (for a while) the closest thing is cohorts.

or hold the refresh (cohorts won’t work for revisions not in the channel map at creation time)

@chipaca we have a converse issue in that, IIRC:

snap install --channel=edge  local.snap

doesn’t remember the tracking channel nor errors on it. The former makes sense probably considering that potentially local.snap could have assertions anyway.

It’s not pretty, but you can redirect the output to a file, but note that this file will contain backspace characters and such so if you just cat that file to the terminal the other output won’t seem to show up, but if you remove those characters somehow or open the file in a text editor which doesn’t actually render those characters, then you can see the full output.

Other than that, I looked and don’t think there is a way to do this, probably worth either a backlog feature request on the forum or a wishlist launchpad bug for an easier way to do this.

But does it require an explicit refresh (user triggered) or will it be auto-refreshed? Consider I install a specific revision and it auto refreshes a little after.

unless you prevent it from refreshing via a hold or a cohort it will auto-refresh as usual.