Mechanism for a snap to query for new revisions / request a refresh?

Does snapd expose a mechanism for a given snap to query for the existence of updates and request a refresh if an update is available?

The use case would be integrating with firefox’s built-in update mechanism, tracked by bug #1505593.

Are you at the summit? Or is this a separate, almost identical request to the one we discussed there?

No, I wasn’t at the summit, and I didn’t hear of that discussion you had there. Would you mind filling me in?

we were all similarly surprised, as two separate teams had independently asked me about the exact same feature at about the same time you were posting this.

For now, the two projects are doing their own thing to address this: one needs to know when a new snap has already been installed and can run a dnotify on $SNAP/.. to alert the user they need to restart; the other will monitor the store and alert the user when a new release is available but not installed yet. Obviously neither of these are ideal, but they unblock the individual projects.

Which of these were you meaning when you said “an update is available”?

I meant getting notified by (or monitoring) the store when a new revision is available. Additionally, there would need to be a (privileged, I suppose) mechanism to ask snapd to install that new revision (and prompt the user to restart the app when done).

Not sure what the exact spelling ought to be, but it would be reasonable for a snap to have access through snapctl to an equivalent of the output of snap refresh --list <the-snap>.

snapctl refresh or similar could also be reasonable.

given that snapctl's audience is scripts, maybe snapctl has-refresh that printed a revision if there was one, and exited with error if not? And snapctl is-refreshed to answer “has this snap already refreshed” (although we hope the second one to become a non-issue soon)