Skip to content

A backup archive deleted outside the launcher blocks every new backup until the limit is raised #507

Description

@Pixnop

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

  1. Make backups of an Installation until it holds six records, with a Backups max amount of 6.
  2. Delete the two oldest archives from the Backups folder in the file explorer. Four archives are left on disk.
  3. Ask for a backup: it is refused with the sentence above.
  4. 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.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions