[gnome-software/fix-flatpak-related-progress] flatpak: Set extensions to updatable properly



commit dcbb13eebd5540e1d1de377936455ff23bf2395f
Author: Matthew Leeds <matthew leeds endlessm com>
Date:   Thu Jul 9 14:34:22 2020 -0700

    flatpak: Set extensions to updatable properly
    
    This avoids the warning "State change on
    user/flatpak/test/runtime/org.test.Chiron.Extension/master from
    installed to installing is not OK", by setting the extension to
    updatable when it is, even though this won't be reflected in the UI (the
    state on the main app will be).
    
    I have also seen this warning when updating an extension for real, not
    just in the unit tests.

 plugins/flatpak/gs-flatpak.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c
index c0602349..d39a3f96 100644
--- a/plugins/flatpak/gs-flatpak.c
+++ b/plugins/flatpak/gs-flatpak.c
@@ -1500,6 +1500,11 @@ gs_flatpak_add_updates (GsFlatpak *self, GsAppList *list,
                if (gs_app_get_state (main_app) != AS_APP_STATE_INSTALLING)
                        gs_app_set_state (main_app, AS_APP_STATE_UPDATABLE_LIVE);
 
+               /* set updatable state on the extension too, as it will have
+                * its state updated to installing then installed later on */
+               if (gs_app_get_state (app) != AS_APP_STATE_INSTALLING)
+                       gs_app_set_state (app, AS_APP_STATE_UPDATABLE_LIVE);
+
                /* already downloaded */
                if (g_strcmp0 (commit, latest_commit) != 0) {
                        g_debug ("%s has a downloaded update %s->%s",


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