From f7235367e234b70470aebab8b51189b0d209ccb3 Mon Sep 17 00:00:00 2001 From: Zaldaryon <273555259+Zaldaryon@users.noreply.github.com> Date: Tue, 18 Aug 2026 15:47:11 -0300 Subject: [PATCH] fix(backups): set _deleting before calling deleteInstallationBackup The DeleteBackupHandler called the domain function without first marking the backup row as _deleting: true. The domain guard at backupDeletion.ts line 28 checks isDeleting, but it was always false because nothing set it before the call. A fast double-click could race two deletes on the same archive. Set _deleting: true via configDispatch before the domain call. On success the row is removed entirely. On failure, clear the flag so the row returns to its normal state. This also makes the isDeleting guard in backupDeletion.ts live code rather than dead, which addresses #149 at the same time. Fixes #145 Fixes #149 --- .../installations/pages/ManageInstallationBackups.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/renderer/src/features/installations/pages/ManageInstallationBackups.tsx b/src/renderer/src/features/installations/pages/ManageInstallationBackups.tsx index 7f975f66..50e2eae2 100644 --- a/src/renderer/src/features/installations/pages/ManageInstallationBackups.tsx +++ b/src/renderer/src/features/installations/pages/ManageInstallationBackups.tsx @@ -96,6 +96,8 @@ function ManageInstallationBackups(): JSX.Element { if (!installation) return addNotification(t("features.installations.noInstallationFound"), "error") if (!backup) return addNotification(t("features.backups.cantDeleteWhileinUse"), "error") + configDispatch({ type: CONFIG_ACTIONS.EDIT_INSTALLATION_BACKUP, payload: { id: installation.id, backupId: backup.id, updates: { _deleting: true } } }) + const result = await deleteInstallationBackup(createBackupDeletionPorts(), { backup: toBackupSnapshot(backup) }) if (result.ok) { @@ -103,6 +105,8 @@ function ManageInstallationBackups(): JSX.Element { return addNotification(t("features.backups.backupDeletedSuccesfully"), "success") } + configDispatch({ type: CONFIG_ACTIONS.EDIT_INSTALLATION_BACKUP, payload: { id: installation.id, backupId: backup.id, updates: { _deleting: false } } }) + const { messageKey, logged } = describeBackupDeletionFailure(result.reason) if (logged) {