gnome-software:jrocha/fix-install-queue

Last commit made on 2018-06-20
Get this branch:
git clone -b jrocha/fix-install-queue https://git.launchpad.net/gnome-software

Branch merges

Branch information

Name:
jrocha/fix-install-queue
Repository:
lp:gnome-software

Recent commits

d10de93... by Joaquim Rocha <email address hidden> on 2018-06-20

Fix how pending apps are installed from the installed page

In the installed page, whenever the list of pending apps changes, the
page will try to install any app in it. This was fine when there were
no limited number of concurrent installations, but right now this may
be a problem (if an app that gets installed by the page goes in the
pending list, then this may trigger another install call from the page
and so on...).

Since the page only cares about installing the apps for when the list
of pending apps is loaded from disk (on start up), to prevent the issue
mentioned above these changes only install the pending apps on start up.
It also skips calling refine on all the pending apps after start up,
since apps are added to the pending apps list usually after being very
recently refined (i.e. we only need to refine them on start up, so this
patch may make things a bit faster in this regard).

https://phabricator.endlessm.com/T21194

d752759... by Joaquim Rocha <email address hidden> on 2018-06-20

Always add apps that are to be installed to the install queue

If there are apps being installed that have been queued because the
plugin loader reached the maximum number of workers in its internal
pool, then apps would still be effectively queued for installation
but not added to the pending apps list. This meant that those queued
apps would never show up in the installed page.

This patch always adds apps to the installation queue when they're
asked to be installed. This has the side effect that if GNOME Software
is quit before the installations succeed, then the pending apps list
is reloaded in the next start up and the apps are installed again.
I believe this behavior is actually desired so I haven't prevented it.

https://phabricator.endlessm.com/T21194

41c72d6... by Joaquim Rocha <email address hidden> on 2018-02-16

Fix updating the installation queue on disk

When an app is removed from the installation queue, it was not updating
the corresponding file on disk. So if an app was uninstalled, the next
time GNOME Software loaded the pending apps, the list would still
contain that previously uninstalled application.

This patch ensures that when an app is removed from the pending apps
queue in memory, the queue is also saved on disk.

1107f92... by Joaquim Rocha <email address hidden> on 2018-02-16

Fix order of saving apps that are queued install

For some reason, the order was being reversed, but since this is a
queue, then it should store and load the apps in the order they have
been requested to be installed.

50cd206... by Joaquim Rocha <email address hidden> on 2018-02-16

Do not use queued apps (for installations) internally as GsApps

If GsApp objects used for storing the apps queued for installation are
used, then they may get created by the plugin loader (before the plugins
create them) which will result in apps getting to a state where they
will not be correctly refined (by not having the keys/metadata some
plugins expect).

For that reason, and for simplicity purposes, this patch makes the
pending apps list as a simple array of unique IDs. This way we can
simply return the globally cached (and correctly created) apps when
using gs_plugin_loader_get_pending.

af12f46... by Joaquim Rocha <email address hidden> on 2018-02-15

Don't install queued when the network changes and is metered

Apps queued for installation were being installed after the network
becomes available and even if the network was metered. This means that
such operation can cost users money without informing them about it, so
this patch adds the extra check before proceeding with the installation.

a4f95bc... by Joaquim Rocha <email address hidden> on 2018-02-15

Allow to cancel installation of apps that were queued for install

When apps were queued for installation, and the network became
available, they were being installed without having any cancellable
being used. This meant that cancelling the installation was not
possible even if the used clicked the cancel button.

This patch makes the installation process in question to use the
cancellable from the app being installed, which is what the cancel
button in the details view uses for cancelling the on-going
operations.

0994e24... by Joaquim Rocha <email address hidden> on 2018-02-16

Try to install the apps that are queued after adding them

After adding the apps that are queued (for installation) to the
installed page, nothing was calling their actual installation. So this
patch does exactly that, provided there's available and unmetered
network.

6a24f76... by Joaquim Rocha <email address hidden> on 2018-02-15

Fix showing the apps queued for installation in the installed page

For showing the apps that are queued for installation in the installed
page, we need to make sure the apps have the information required for
them to be shown, and thus they need to be refined with the flags that
the installed page needs.

This patch gets the list of pending apps from the plugin loader and then
runs the refine action on them; and when the refine is done, the apps
are added to the page.

e4ee892... by Joaquim Rocha <email address hidden> on 2018-02-15

Save/load install queue using unique IDs

When saving and loading the apps in the installation queue, unique IDs
should be used instead of simple IDs. The reason for this is that if
only simple IDs are used, then there's no way of checking which apps
really need to be installed (e.g. there can be an app with the same
simple ID coming from Flatpak or from PackageKit).