[gnome-software/630-flatpak-updates-are-stuck-in-installing-state-when-flatpak-update-was-already-done-outside: 101/103] gs-flatpak: Ensure origin before using it in refine app state




commit 44471e14ceafe75a55c757d5f80ff334c4f63631
Author: Milan Crha <mcrha redhat com>
Date:   Mon Mar 22 10:36:36 2021 +0100

    gs-flatpak: Ensure origin before using it in refine app state
    
    The gs_flatpak_refine_app_state_unlocked() uses app's origin, but
    it ensures its value only after it is used, which can lead to not
    find the application in the list of the installed references.

 plugins/flatpak/gs-flatpak.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c
index 981030861..9b0484dff 100644
--- a/plugins/flatpak/gs-flatpak.c
+++ b/plugins/flatpak/gs-flatpak.c
@@ -1899,6 +1899,10 @@ gs_flatpak_refine_app_state_unlocked (GsFlatpak *self,
        if (!gs_refine_item_metadata (self, app, cancellable, error))
                return FALSE;
 
+       /* ensure origin set */
+       if (!gs_plugin_refine_item_origin (self, app, cancellable, error))
+               return FALSE;
+
        /* find the app using the origin and the ID */
        g_mutex_lock (&self->installed_refs_mutex);
 
@@ -1948,10 +1952,6 @@ gs_flatpak_refine_app_state_unlocked (GsFlatpak *self,
                return TRUE;
        }
 
-       /* ensure origin set */
-       if (!gs_plugin_refine_item_origin (self, app, cancellable, error))
-               return FALSE;
-
        /* anything not installed just check the remote is still present */
        if (gs_app_get_state (app) == GS_APP_STATE_UNKNOWN &&
            gs_app_get_origin (app) != NULL) {


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