From 6a5d56894426a9513d96a30fc5d27ad4b9364b53 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 29 Apr 2026 22:39:12 -0400 Subject: [PATCH] fix: remove the per-app property folder on app delete and rename Switches the storage plugin's post-delete and post-app-rename-setup triggers from rewriting the attachment list as empty to removing the per-app property folder outright via PropertyDestroy. This matches the convention other plugins use on app deletion and avoids leaving an empty mounts file behind for an app that no longer exists. --- plugins/storage/triggers.go | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/plugins/storage/triggers.go b/plugins/storage/triggers.go index c8f8b30a6..1d5b00747 100644 --- a/plugins/storage/triggers.go +++ b/plugins/storage/triggers.go @@ -58,19 +58,15 @@ func TriggerInstall() error { return nil } -// TriggerPostDelete clears any attachment list for an app that's being -// destroyed. Entries are global and survive app deletion. Skipped when -// the app has no attachments to begin with so we don't trigger a -// pointless propertyTouch that could fail on installs with no -// property-list state for this plugin yet. +// TriggerPostDelete removes the attachment store for an app that's being +// destroyed. Entries are global and survive app deletion. The whole +// per-app property folder goes away rather than being rewritten as +// empty, matching what other plugins do on app deletion. func TriggerPostDelete(appName string) error { if appName == "" { return nil } - if !common.PropertyExists(PluginName, appName, AttachmentsProperty) { - return nil - } - return common.PropertyListWrite(PluginName, appName, AttachmentsProperty, []string{}) + return common.PropertyDestroy(PluginName, appName) } // TriggerPostAppCloneSetup copies attachments from the source app to the @@ -90,7 +86,7 @@ func TriggerPostAppCloneSetup(oldName string, newName string) error { } // TriggerPostAppRenameSetup moves attachments from the old name to the -// new name and clears the old. +// new name and removes the old per-app property folder. func TriggerPostAppRenameSetup(oldName string, newName string) error { if oldName == "" || newName == "" { return nil @@ -105,7 +101,7 @@ func TriggerPostAppRenameSetup(oldName string, newName string) error { if err := SaveAttachments(newName, attachments); err != nil { return err } - return common.PropertyListWrite(PluginName, oldName, AttachmentsProperty, []string{}) + return common.PropertyDestroy(PluginName, oldName) } // detectDistro returns the Linux distribution name