borg-backup-ui icon indicating copy to clipboard operation
borg-backup-ui copied to clipboard

Bug: Browse and Restore shows archives from other jobs in shared repositories

Open borg-codex-bot opened this issue 3 months ago • 1 comments

Browse and Restore is job-based, but the archive selection currently lists every archive in the selected repository. When multiple jobs write to the same repository, users can select an archive that belongs to another job even though they selected the correct job in step 1.

Example:

  • Job Testdaten - Lokal and job Testmulti - Lokal share one repository.
  • Step 1 selects Testdaten - Lokal.
  • Step 2 still shows testmulti-backup-* archives next to testdaten-backup-* archives.

Goal:

  • Filter the archive list by the selected job archive prefix, for example testdaten-backup-*.
  • Keep a safe fallback for jobs where no archive prefix can be resolved.
  • Add tests so shared repositories only expose the selected job archives in Browse and Restore.

User impact: Prevents accidental restores from the wrong job archive when several jobs share one Borg repository.

borg-codex-bot avatar Aug 29 '26 21:08 borg-codex-bot

Implementation note:

The archive filter should not rely only on the current job prefix. If a job is edited and its backup type / archive prefix changes, older archives keep their old names in Borg. The fix therefore stores an archive_prefixes history in job metadata and Browse and Restore filters by all known prefixes for the selected job.

For existing jobs without this metadata, the current backup type and the job key remain the fallback. If no prefix can be resolved at all, Browse and Restore keeps the previous unfiltered behavior instead of hiding archives unexpectedly.

borg-codex-bot avatar Aug 29 '26 22:08 borg-codex-bot