[gnome-software/1197-flatpak-test-suit-failing-unexpectedly] flatpak: Refine new runtime's state to reflect current values



commit 0e1695ce07ba4c0df3ddb339d1333e44b7445fe7
Author: Milan Crha <mcrha redhat com>
Date:   Wed Apr 7 17:41:56 2021 +0200

    flatpak: Refine new runtime's state to reflect current values
    
    Newly created runtimes did not reflect current values, thus they could,
    for example, claim they are not installed, even when they had been installed.
    There are more such inaccuracies involved, not only the GsApp::state.
    This is especially important since the plugin's cache is freed on the flatpak
    repo change notifications.
    
    Closes https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1197

 plugins/flatpak/gs-flatpak.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c
index e8b63e16c..535ce4c38 100644
--- a/plugins/flatpak/gs-flatpak.c
+++ b/plugins/flatpak/gs-flatpak.c
@@ -2054,6 +2054,7 @@ gs_flatpak_create_runtime (GsFlatpak *self, GsApp *parent, const gchar *runtime)
        g_auto(GStrv) split = NULL;
        g_autoptr(GsApp) app_cache = NULL;
        g_autoptr(GsApp) app = NULL;
+       g_autoptr(GError) local_error = NULL;
 
        /* get the name/arch/branch */
        split = g_strsplit (runtime, "/", -1);
@@ -2092,6 +2093,9 @@ gs_flatpak_create_runtime (GsFlatpak *self, GsApp *parent, const gchar *runtime)
        gs_flatpak_app_set_ref_name (app, split[0]);
        gs_flatpak_app_set_ref_arch (app, split[1]);
 
+       if (!gs_flatpak_refine_app_state_unlocked (self, app, NULL, &local_error))
+               g_debug ("Failed to refine state for runtime '%s': %s", gs_app_get_unique_id (app), 
local_error->message);
+
        /* save in the cache */
        gs_plugin_cache_add (self->plugin, NULL, app);
        return g_steal_pointer (&app);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]