From abda8838f2a3ee50c2a201474b04f7227842ef86 Mon Sep 17 00:00:00 2001 From: Leonhard Kargl Date: Wed, 25 Feb 2026 16:17:33 +0100 Subject: [PATCH 1/2] FlatpakBackend: Fix identifying main thread --- src/Core/FlatpakBackend.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Core/FlatpakBackend.vala b/src/Core/FlatpakBackend.vala index adde2f618..a5cc8e729 100644 --- a/src/Core/FlatpakBackend.vala +++ b/src/Core/FlatpakBackend.vala @@ -1333,7 +1333,7 @@ public class AppCenterCore.FlatpakBackend : Object, Backend { package_list = new_package_list; - if (MainContext.get_thread_default () == null) { + if (Thread.self () != worker_thread) { // We are in the main thread so update immediately update_package_store (removed, added); } else { From 39444321bd0e8befb30d8d34f84afdaaca8d7065 Mon Sep 17 00:00:00 2001 From: Leonhard Kargl Date: Wed, 25 Feb 2026 16:21:43 +0100 Subject: [PATCH 2/2] Add normalize_component_id Utils function --- src/Core/Package.vala | 6 +----- src/Utils.vala | 9 +++++++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Core/Package.vala b/src/Core/Package.vala index 360366bab..5136b80f0 100644 --- a/src/Core/Package.vala +++ b/src/Core/Package.vala @@ -147,11 +147,7 @@ public class AppCenterCore.Package : Object { return _component_id; } - _component_id = component.id; - if (_component_id.has_suffix (".desktop")) { - // ".desktop" is always 8 bytes in UTF-8 so we can just chop 8 bytes off the end - _component_id = _component_id.substring (0, _component_id.length - 8); - } + _component_id = Utils.normalize_component_id (component.id); return _component_id; } diff --git a/src/Utils.vala b/src/Utils.vala index 3a54b16aa..027f644c0 100644 --- a/src/Utils.vala +++ b/src/Utils.vala @@ -83,4 +83,13 @@ namespace Utils { public static bool is_running_in_guest_session () { return Environment.get_user_name ().has_prefix ("guest-"); } + + public static string normalize_component_id (string component_id) { + if (component_id.has_suffix (".desktop")) { + // ".desktop" is always 8 bytes in UTF-8 so we can just chop 8 bytes off the end + return component_id.substring (0, component_id.length - 8); + } + + return component_id; + } }