Snap refresh behaviour is really strange.
Snap refresh behaviour is really strange.
Posted Feb 24, 2023 16:09 UTC (Fri) by smcv (subscriber, #53363)In reply to: Snap refresh behaviour is really strange. by farnz
Parent article: No more Flatpak (by default) in Ubuntu Flavors
If you update a Flatpak app or runtime while the app is *not* running, then the old version will be cleaned up immediately (in the case of a runtime, this only happens if there is no running app that uses that runtime). If an instance of the app is running, it holds a lock which prevents that cleanup, but the "active" version swaps to the new one, so running another instance of the same app in parallel will give the new instance its updated /app and /usr. The old version will eventually be cleaned up, during the next update that takes place after the first instance has exited.
I don't know whether Snap does this. I would hope so, it's certainly in a position to use similar tricks if it wants to?
Of course, for particularly security-sensitive apps like Firefox, there's an incentive for the app to prompt you to exit and restart even if it's somewhat disruptive to do so, to make sure you're really running the updated version with its security fixes: there's a usability/security tradeoff here, and we can't realistically insert code changes into a running process, however important they might be.
Posted Feb 24, 2023 16:15 UTC (Fri)
by farnz (subscriber, #17727)
[Link]
The reason I said "in theory" is that I've not tested Flatpak's behaviour. Snap currently requires you to close the app to update it - it won't download and install a newer version in parallel to the old version, and thus you have to quit your app, apply the update, and then restart.
I'm glad to hear that Flatpak does the right thing here - as a user, I want to be able to say "sure, get all the updates and install them" while I'm on mains power and reliable fast Internet, but I may not be able to restart the app to get the new version running until I've finished a chunk of work (which I may, in turn, not be able to do until I'm on a coach or train journey). The only thing you've not cleared up for me is whether it's easy, in the Flatpak world, to determine which apps I need to restart to update - it's obviously technically possible based on your description, but whether any of the front ends tell me "hey, you have Firefox 109 running, but the currently active version is 114.3 - restart Firefox to update" is a different question,
Posted Feb 24, 2023 21:27 UTC (Fri)
by himi (subscriber, #340)
[Link]
The usability/user-interaction question obviously has no clearly superior answer, and arguably would have different answers for different use cases (server versus desktop, system software versus end user, developer versus regular user, etc), but I think it's pretty hard to argue with implementing support for a "minimum downtime" approach that does as much as possible of the time consuming download and update in the background before requiring the running process to go away. Snap is definitely failing at that right now, for unknown reasons.
Snap refresh behaviour is really strange.
Snap refresh behaviour is really strange.