What happens
An Installation with a Backups max amount of 6 refuses to make a backup. Raising the limit to 7 makes the same backup go through straight away. The player reads:
No backup made: an old backup could not be removed to make room for the new one.
Reported on Discord by NekoJess, on 1.7.0-beta.10, with four archives sitting in the Backups folder.
Why
A backup record whose archive is no longer on disk can never be deleted, and it keeps its slot under the limit forever.
DELETE_PATH runs the path through assertManagedDeletionPath, which asserts the path with allowMissing: false (src/ipc/pathPolicy.ts:196), so a file that is not there throws and the handler answers false (src/ipc/handlers/pathsHandlers.ts:278-285). The domain reads that single false as "the file is still there" (src/domain/installations/backupDeletion.ts:29).
The prune in makeInstallationBackup starts as soon as the record count reaches the limit (src/domain/installations/backup.ts:110) and gives up on the whole backup at the first refusal (src/domain/installations/backup.ts:124), which the renderer turns into the sentence above (src/renderer/src/features/installations/adapters/backupFailure.ts:64).
So the records count toward the limit, the oldest one cannot be pruned, and every new backup is refused. Raising the limit above the record count skips the prune entirely, which is why 7 worked.
The same dead record also breaks the Delete button on the Manage Backups page ("There was an error deleting the Backup.", the row never goes away) and gets reported as a leftover archive when the Installation is deleted with its data.
Reproduction
- Make backups of an Installation until it holds six records, with a Backups max amount of 6.
- Delete the two oldest archives from the Backups folder in the file explorer. Four archives are left on disk.
- Ask for a backup: it is refused with the sentence above.
- Raise the Backups max amount to 7: the same backup is made.
Covered as a unit test against the domain in tests/domain/installations/backup.test.ts and end to end through the hook in tests/renderer-dom/useMakeInstallationBackup.test.tsx.
Expected
An archive that is already gone is not a reason to refuse anything. The record should come off with it, and the backup should be made.
What happens
An Installation with a Backups max amount of 6 refuses to make a backup. Raising the limit to 7 makes the same backup go through straight away. The player reads:
Reported on Discord by NekoJess, on 1.7.0-beta.10, with four archives sitting in the Backups folder.
Why
A backup record whose archive is no longer on disk can never be deleted, and it keeps its slot under the limit forever.
DELETE_PATHruns the path throughassertManagedDeletionPath, which asserts the path withallowMissing: false(src/ipc/pathPolicy.ts:196), so a file that is not there throws and the handler answersfalse(src/ipc/handlers/pathsHandlers.ts:278-285). The domain reads that singlefalseas "the file is still there" (src/domain/installations/backupDeletion.ts:29).The prune in
makeInstallationBackupstarts as soon as the record count reaches the limit (src/domain/installations/backup.ts:110) and gives up on the whole backup at the first refusal (src/domain/installations/backup.ts:124), which the renderer turns into the sentence above (src/renderer/src/features/installations/adapters/backupFailure.ts:64).So the records count toward the limit, the oldest one cannot be pruned, and every new backup is refused. Raising the limit above the record count skips the prune entirely, which is why 7 worked.
The same dead record also breaks the Delete button on the Manage Backups page ("There was an error deleting the Backup.", the row never goes away) and gets reported as a leftover archive when the Installation is deleted with its data.
Reproduction
Covered as a unit test against the domain in
tests/domain/installations/backup.test.tsand end to end through the hook intests/renderer-dom/useMakeInstallationBackup.test.tsx.Expected
An archive that is already gone is not a reason to refuse anything. The record should come off with it, and the backup should be made.