Deploy Flatpak updates immediately, in separate transactions
Please describe the issue you’re experiencing:
GNOME Software distinguishes between "download" and "update". For the Flatpak plugin these actions have the following meaning:
-
gs_plugin_download
: for eachFlatpakInstallation
:- build a
FlatpakTransaction
that updates all apps & runtimes, withflatpak_transaction_set_no_deploy (transaction, TRUE)
set - run the transaction
- mark each app with
gs_app_set_is_update_downloaded (app, TRUE)
- build a
-
gs_plugin_update
: for eachFlatpakInstallation
:- build a suspiciously similar
FlatpakTransaction
that updates all apps & runtimes. - If
gs_app_get_is_update_downloaded (app)
is TRUE for all apps, then setflatpak_transaction_set_no_pull (transaction, TRUE)
. - run the transaction
- build a suspiciously similar
There are two major practical problems with this in the case where more than 1 app has an available update:
- Suppose you have 125 pending updates, but you run out of disk space after pulling & installing with no-deploy 124 of them. Then you are left with a full disk, and two copies of most of the apps.
- Suppose something exciting goes wrong with one of the updates – maybe there is repo corruption, or an extra data app's extra data has gone missing, or whatever. This aborts the whole transaction. So you are left without automatic updates for most apps, just because one app was problematic.
On my system I have 308 installed refs. Software shows a "125" badge on the Updates tab. (Automatic updates have been broken on my system for months due to the bug !1485 (merged) refers to.) 89 of them have updates installed but not deployed. My disk was nearly full. While Software was pulling updates, I hurried along the process of the disk filling up by creating some large files, and sure enough the whole operation failed.
(There's also an edge case with eol-rebase
here. Apparently com.github.gi_lom.dialect
was renamed to app.drey.Dialect
and (correctly) has eol-rebase
set. As part of the no-deploy transaction, com.github.gi_lom.dialect
was uninstalled; but app.drey.Dialect
was not fully installed. As a result I have effectively lost an app as part of the daily automatic update run. This is tracked as #1711 (closed) though.)
I think Software should approach Flatpak updates differently:
- Don't split download & deploy for Flatpak apps. Updates should be deployed as they are pulled.
- One transaction per
GsApp
, not one per installation.
This would have the downside that the Flatpak repo would be pruned once per logical update. Pruning is an expensive operation. But the silver lining is that you only need enough disk space to store 2 copies (modulo deduplication) of a single app (and its runtimes), rather than all pending updates.
What Linux distribution are you using, and what kind of package (RPM, deb, flatpak, etc.) are you experiencing the problem with?
Endless OS development branch, with gnome-software 43.0-51-gef29475c4. This is in fact upstream commit ad886836 plus a mere 19 patches, not the 51 that the git describe
might suggest.
Please attach a log of the issue
I do have a log... It's 27MB and I'm not sure it is really useful.