[gnome-software/misc-flatpak-fixes: 55/55] flatpak: Add app to be uninstalled to txn cache



commit bacce5e284574ae5bf23389ae4b6961b89330737
Author: Matthew Leeds <matthew leeds endlessm com>
Date:   Fri Feb 21 17:00:29 2020 -0800

    flatpak: Add app to be uninstalled to txn cache
    
    This mirrors what we do for install operations, and ensures that the
    GsApp object used by the GsFlatpakTransaction will be the same one which
    was passed to gs_plugin_app_remove(), which prevents this warning:
    
    (/builds/mwleeds/gnome-software/_build/plugins/flatpak/gs-self-test-flatpak:1689):
    Gs-WARNING **: 21:05:06.803: application
    user/flatpak/chiron1-origin/desktop/org.test.Chiron/master left in
    removing helper

 plugins/flatpak/gs-plugin-flatpak.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/plugins/flatpak/gs-plugin-flatpak.c b/plugins/flatpak/gs-plugin-flatpak.c
index 4d6a81ba..f787ff2c 100644
--- a/plugins/flatpak/gs-plugin-flatpak.c
+++ b/plugins/flatpak/gs-plugin-flatpak.c
@@ -590,6 +590,11 @@ gs_plugin_app_remove (GsPlugin *plugin,
                gs_flatpak_error_convert (error);
                return FALSE;
        }
+
+       /* add to the transaction cache for quick look up -- other unrelated
+        * refs will be matched using gs_plugin_flatpak_find_app_by_ref() */
+       gs_flatpak_transaction_add_app (transaction, app);
+
        ref = gs_flatpak_app_get_ref_display (app);
        if (!flatpak_transaction_add_uninstall (transaction, ref, error)) {
                gs_flatpak_error_convert (error);


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