Backport MR #1635 to fix update notifications

This commit is contained in:
Adam Williamson 2023-02-23 13:19:04 -08:00
parent e710d3931e
commit 6e1e4a25c9
2 changed files with 53 additions and 1 deletions

View File

@ -0,0 +1,45 @@
From f6594bb461617a92801cfbe5dd4017898119b72d Mon Sep 17 00:00:00 2001
From: Milan Crha <mcrha@redhat.com>
Date: Thu, 23 Feb 2023 16:10:33 +0100
Subject: [PATCH] gs-update-monitor: No notification of prepared updates
This is a regression in 44.beta, the job returns empty list of apps,
because its existence only indicates success or failure. Due to that
there was not recognized any online nor offline update, thus no notification
was done afterwards. Check the app list used in the update job instead.
---
src/gs-update-monitor.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/gs-update-monitor.c b/src/gs-update-monitor.c
index 6361ddbbb..b7ed2c344 100644
--- a/src/gs-update-monitor.c
+++ b/src/gs-update-monitor.c
@@ -486,8 +486,9 @@ download_finished_cb (GObject *object, GAsyncResult *res, gpointer user_data)
g_autoptr(GsAppList) list = NULL;
g_autoptr(GsAppList) update_online = NULL;
g_autoptr(GsAppList) update_offline = NULL;
+ GsAppList *job_apps;
- /* get result */
+ /* the returned list is always empty, the existence indicates success */
list = gs_plugin_loader_job_process_finish (plugin_loader, res, &error);
if (list == NULL) {
gs_plugin_loader_claim_job_error (plugin_loader,
@@ -497,10 +498,11 @@ download_finished_cb (GObject *object, GAsyncResult *res, gpointer user_data)
return;
}
+ job_apps = gs_plugin_job_update_apps_get_apps (GS_PLUGIN_JOB_UPDATE_APPS (data->job));
update_online = gs_app_list_new ();
update_offline = gs_app_list_new ();
- for (guint i = 0; i < gs_app_list_length (list); i++) {
- GsApp *app = gs_app_list_index (list, i);
+ for (guint i = 0; i < gs_app_list_length (job_apps); i++) {
+ GsApp *app = gs_app_list_index (job_apps, i);
if (_should_auto_update (app)) {
g_debug ("auto-updating %s", gs_app_get_unique_id (app));
gs_app_list_add (update_online, app);
--
2.39.2

View File

@ -21,7 +21,7 @@
Name: gnome-software
Version: 44~beta
Release: 1%{?dist}
Release: 2%{?dist}
Summary: A software center for GNOME
License: GPL-2.0-or-later
@ -29,6 +29,10 @@ URL: https://wiki.gnome.org/Apps/Software
Source0: https://download.gnome.org/sources/gnome-software/44/%{name}-%{tarball_version}.tar.xz
Patch01: 0001-crash-with-broken-theme.patch
# https://gitlab.gnome.org/GNOME/gnome-software/-/merge_requests/1635
# https://bugzilla.redhat.com/show_bug.cgi?id=2172662
# Fix update notifications
Patch02: 0001-gs-update-monitor-No-notification-of-prepared-update.patch
BuildRequires: docbook-style-xsl
BuildRequires: desktop-file-utils
@ -228,6 +232,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop
%{_datadir}/gtk-doc/html/gnome-software/
%changelog
* Thu Feb 23 2023 Adam Williamson <awilliam@redhat.com> - 44~beta-2
- Backport MR #1635 to fix update notifications
* Tue Feb 14 2023 Milan Crha <mcrha@redhat.com> - 44.beta-1
- Update to 44.beta