[gnome-shell] extensionDownloader: Remove pending updates with extension



commit d3939a38a383b38448b8f5ef55a509b0eaddbfba
Author: Florian Müllner <fmuellner gnome org>
Date:   Mon Mar 9 16:49:34 2020 +0100

    extensionDownloader: Remove pending updates with extension
    
    When an extension is uninstalled, there is no point in keeping
    a pending update: If the update didn't fail (which it currently
    does), we would end up sneakily reinstalling the extension.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/issues/2343

 js/ui/extensionDownloader.js | 9 +++++++++
 1 file changed, 9 insertions(+)
---
diff --git a/js/ui/extensionDownloader.js b/js/ui/extensionDownloader.js
index be7426be09..b399394b1b 100644
--- a/js/ui/extensionDownloader.js
+++ b/js/ui/extensionDownloader.js
@@ -56,6 +56,15 @@ function uninstallExtension(uuid) {
         return false;
 
     FileUtils.recursivelyDeleteDir(extension.dir, true);
+
+    try {
+        const updatesDir = Gio.File.new_for_path(GLib.build_filenamev(
+            [global.userdatadir, 'extension-updates', extension.uuid]));
+        FileUtils.recursivelyDeleteDir(updatesDir, true);
+    } catch (e) {
+        // not an error
+    }
+
     return true;
 }
 


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