Bug: Browse and Restore shows archives from other jobs in shared repositories
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 - Lokaland jobTestmulti - Lokalshare one repository. - Step 1 selects
Testdaten - Lokal. - Step 2 still shows
testmulti-backup-*archives next totestdaten-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.
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.