[gnome-software/1271-40-2-flatpaks-not-updated-despite-notification] gs-update-monitor: Request to receive action error
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/1271-40-2-flatpaks-not-updated-despite-notification] gs-update-monitor: Request to receive action error
- Date: Tue, 29 Jun 2021 12:34:48 +0000 (UTC)
commit 7cabf81283555c199ad99c6bdfa5d2f5e62a25c5
Author: Milan Crha <mcrha redhat com>
Date: Tue Jun 29 14:32:53 2021 +0200
gs-update-monitor: Request to receive action error
This is needed to know whether the action really succeeded or not,
to avoid false notifications about updated applications in the background.
Closes https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1271
src/gs-update-monitor.c | 25 +++++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
---
diff --git a/src/gs-update-monitor.c b/src/gs-update-monitor.c
index cae30139a..21ba4088e 100644
--- a/src/gs-update-monitor.c
+++ b/src/gs-update-monitor.c
@@ -385,14 +385,19 @@ static void
update_finished_cb (GObject *object, GAsyncResult *res, gpointer data)
{
GsUpdateMonitor *monitor = GS_UPDATE_MONITOR (data);
+ GsPluginLoader *plugin_loader = GS_PLUGIN_LOADER (object);
g_autoptr(GError) error = NULL;
g_autoptr(GsAppList) list = NULL;
/* get result */
- list = gs_plugin_loader_job_process_finish (GS_PLUGIN_LOADER (object), res, &error);
+ list = gs_plugin_loader_job_process_finish (plugin_loader, res, &error);
if (list == NULL) {
- if (!g_error_matches (error, GS_PLUGIN_ERROR, GS_PLUGIN_ERROR_CANCELLED))
- g_warning ("failed update application: %s", error->message);
+ gs_plugin_loader_claim_error (plugin_loader,
+ NULL,
+ GS_PLUGIN_ACTION_UPDATE,
+ NULL,
+ TRUE,
+ error);
return;
}
@@ -424,16 +429,21 @@ static void
download_finished_cb (GObject *object, GAsyncResult *res, gpointer data)
{
GsUpdateMonitor *monitor = GS_UPDATE_MONITOR (data);
+ GsPluginLoader *plugin_loader = GS_PLUGIN_LOADER (object);
g_autoptr(GError) error = NULL;
g_autoptr(GsAppList) list = NULL;
g_autoptr(GsAppList) update_online = NULL;
g_autoptr(GsAppList) update_offline = NULL;
/* get result */
- list = gs_plugin_loader_job_process_finish (GS_PLUGIN_LOADER (object), res, &error);
+ list = gs_plugin_loader_job_process_finish (plugin_loader, res, &error);
if (list == NULL) {
- if (!g_error_matches (error, GS_PLUGIN_ERROR, GS_PLUGIN_ERROR_CANCELLED))
- g_warning ("failed to get updates: %s", error->message);
+ gs_plugin_loader_claim_error (plugin_loader,
+ NULL,
+ GS_PLUGIN_ACTION_DOWNLOAD,
+ NULL,
+ TRUE,
+ error);
return;
}
@@ -454,6 +464,7 @@ download_finished_cb (GObject *object, GAsyncResult *res, gpointer data)
g_autoptr(GsPluginJob) plugin_job = NULL;
plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_UPDATE,
"list", update_online,
+ "propagate-error", TRUE,
NULL);
gs_plugin_loader_job_process_async (monitor->plugin_loader,
plugin_job,
@@ -524,6 +535,7 @@ get_updates_finished_cb (GObject *object, GAsyncResult *res, gpointer data)
* preferences */
plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_DOWNLOAD,
"list", apps,
+ "propagate-error", TRUE,
NULL);
g_debug ("Getting updates");
gs_plugin_loader_job_process_async (monitor->plugin_loader,
@@ -559,6 +571,7 @@ get_updates_finished_cb (GObject *object, GAsyncResult *res, gpointer data)
plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_DOWNLOAD,
"list", update_online,
+ "propagate-error", TRUE,
NULL);
g_debug ("Getting %u online updates", gs_app_list_length (update_online));
gs_plugin_loader_job_process_async (monitor->plugin_loader,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]