[WIP] Refresh App Awareness

I’m a big fan of this feature, especially for applications like code-insider which gets updates daily.

Could an option be added to not pester the user to update so frequently, though? Currently, it asks at least daily, though it feels like it’s multiple times a day occasionally. :thinking:

I assume I’m not the only one that doesn’t like to be pestered with it while I’m using the application? I’d like to restart/update at the end of the day or over the weekend. ^-^’

1 Like

Were a huge fan of this feature as well since our Kiosk snap runs in a business environment in front of customers on TV displays all day long. We are having problems with the updates happening during business hours and crashing the app due to file locks or other issues. This would be awesome to elevate this as a standard feature and not experimental. +1 vote for me :wink:

4 Likes

Is there any way to enable this from the apps side of things? Obviously most users don’t have this setting enabled yet.

Any plans to make this a standard feature of snapd?

Yes. I’ve recently been working on some improvements to how desktop notifications are handled, and the plan is to finish this feature this cycle and make it the standard (non-experimental).

8 Likes

No, but we have worked on a different mechanism to have some complementary level of control from the snap side of things: Refresh control

Main use cases are situations where services, not apps, need not to be interrupted during some operations.

This starts as experimental as well but we think it should be non-experimental relatively soon.

So I enabled this feature a while ago and have not found it very useful. My main snap is spotify, which runs 24/7, so I get the notifications to close the app. But then it will take until the next refresh window to apply the update, so it’s not useful, as I’ll only close the app very shortly to reboot or fix sound issues.

It would be much more useful to me if the update could already be prepared in the background, and then applied the next time I launch the app / reboot.

(The other snap I get the notification for is scrcpy which keeps around adb processes indefinitely, ugh, maybe this needs to be toggable per snap)

6 Likes

I agree. I end up manually closing, refreshing and then restarting Chromium to make sure I get it updated.

Isn’t what you describe the Chrome OS/Chrome (on Win/Mac) native updater behavior?

I think a dedicated refresh step in the logout or login phase where refreshes can be applied is an interesting idea.

Consider the discussion from https://bugs.launchpad.net/snapd/+bug/1944447 : It seems that refresh app awareness must also take dependencies (i.e. platform snap & base snap) into account. If that’s the case, there’s also very likely always at least one app running that’s using the same dependency as another app.

So in essence, the desktop would need to be idling without any running snaps that depend on the other snaps to be refreshed. Depending on how many desktop snaps are used, that’s not a likely scenario to occur.

1 Like

We will certainly discuss this with the team, I think this is a reasonable suggestion but needs work; we would need to teach snapd to pre-download snaps and try to refresh them on first opportunity on startup (and there are probably edge cases to consider) without waiting for next refresh window and without waiting for our internal ensure-loop interval of 5 minutes (the interval where snapd considers/looks up for things to do).

Thanks for the feedback!

1 Like

Is experimental.refresh-app-awareness=true enabled by default on Ubuntu 22.04?

I am using a recent daily ISO of Ubuntu 22.04 (last week) and this key is not set.

It’s expected to be default in snapd 2.56, there’s no time to bake that into the 22.04 GA ISO, but it’ll be available as an update (via the snapd snap) soon afterwards.

The snapd snap latest/stable channel has been updated to version 2.55.5 today, and with it brings refresh app awareness as default!

Thanks to everyone who’s worked on it :heart:

7 Likes

Hi! @James-Carroll

Is there a reason why my snapd wont refresh to 2.55.5, if I use snap info snapd there show the new version, but when I use snap refresh snapd it’s says:

snap "snapd" has no updates available

I’m not really the best person to answer that, but I’d put a guess on that the store may be throttling downloads temporarily to prevent resource exhaustion, but there could be other explanations such as you might be following a short lived branch such as hypothetically latest/stable/ubuntu-22.04 Whether this one specifically exists, I’m unsure; but some snaps baked into the Ubuntu releases tend to have the pattern of using a branch release specific to the distributions release, which later realigns with latest/stable but at any given point might actually be slightly different to it.

Try

sudo snap refresh --channel latest/stable snapd

In the general case however, I’d expect it would update itself as expected eventually :slight_smile:

1 Like

Thank you! @James-Carroll :slight_smile:

I’m concerned that with the default enabling this, users not manually enabling the feature now don’t know what to do. The notification tells them to close Firefox. So they do. Then what? By default, the snap isn’t refreshed, and they restart Firefox without it having been updated.

People who enabled the experimental feature might be expected to understand how to refresh a snap manually. But that’s not something your everyday user on defaults could be expected to know.

What is the intended UX here?

Are they expected to wait with Firefox closed (but with the desktop session running) for up to six hours for the default refresh schedule to take effect? Or are they expected to refresh the snap manually?

More importantly, how are they expected to know what they’re expected to do?

6 Likes

Came here to comment about the new Snap refresh behaviour but this sums up my thoughts. I for one was somewhat blindsided by the new change, and since I manage a fleet of Ubuntu (20.04 LTS) machines (the users of which are not all Linux-literate), I too would love to know what is the intended workflow for updating snaps now?

If I understood correctly, previously snaps would simply refresh, and if they were ‘busy’, would remain open with the old version until you closed the app. This was a pretty simple workflow, which even basic users could understand (or weren’t even aware of).

But now you’re prompted to close the app, with no further information.

I think the worst part is that I simply had no idea this feature was heading my way.

I appreciate there are use-cases for this, but to me at least, the implementation is not ready for full roll-out.

1 Like

Not a snap dev, so I can’t comment on future plans; however the snap will eventually update regardless, with the same behaviour as it used to. When the 14 days runs out, if there’s still not been an opportunity to refresh, it will happen even with the app running.

No further information, no way of know if it was updated (unless you ran snap refresh).

Earlier this week, my Firefox (stable channel) was prompted to close because of pending update. To my surprise, I still find it asking to be updated, and it was still on v100 all this time. It wasn’t until I ran snap refresh that I discovered that the cause was the geckodriver alias already being used by my Firefox beta parallel install.