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



commit 9410c83a5dc97e81c3d451bc89479499ae7a75b9
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 0a229f81..17cb66ef 100644
--- a/plugins/flatpak/gs-plugin-flatpak.c
+++ b/plugins/flatpak/gs-plugin-flatpak.c
@@ -579,6 +579,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]