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

Warn and require confirmation before changing a job repository

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

Summary

Editing an existing backup job currently allows its repository assignment to be changed without a dedicated warning or confirmation.

Changing the assignment does not move existing Borg archives. Future backup runs use the newly selected repository, while existing archives remain in the previous repository and are no longer available through that job in Browse & Restore.

Show an explicit warning and require confirmation before saving this change.

Current behavior

  • Each job has one current repository_key.
  • A repository can only be removed or deleted when no jobs are assigned to it.
  • The wizard permits selecting another repository while editing a job.
  • Saving updates the 1:1 assignment atomically.
  • Existing archives are not moved.
  • The wizard does not explain these consequences.

Required behavior

When editing an existing job and repository_key differs from its original value:

  • Show a clear warning before the job is saved.
  • State that future backups will be written to the new repository.
  • State that existing archives will not be moved and remain in the previous repository.
  • State that those archives will no longer be available through this job in Browse & Restore.
  • Require an explicit user confirmation.
  • Display both the previous and new repository names when available.
  • Do not require confirmation when creating a job or saving without changing the repository.
  • Enforce the confirmation contract server-side so direct API calls cannot bypass it silently.

Suggested message:

This job's repository will be changed. Future backups will be written to the new repository. Existing archives will not be moved and remain in the previous repository. They will no longer be available through this job in Browse & Restore.

Scope

  • Keep the current 1:1 job-to-repository model.
  • Keep only the current repository_key on the job.
  • Do not add repository assignment history.
  • Do not move, copy, prune, or delete archives.
  • Do not change repository deletion rules.

Historical archive prefixes are already preserved in the job's archive_prefixes field and are outside the scope of this issue.

Relationship to #447

Issue #447 introduces immutable job identity. This issue is the separate user-safety confirmation for changing the mutable repository assignment. Repository assignment history is not required by either implementation.

Acceptance criteria

  • Editing a job without changing its repository behaves as before.
  • Selecting another repository presents the consequence warning.
  • Saving the changed assignment requires explicit confirmation.
  • Cancelling the confirmation leaves the job and repository assignments unchanged.
  • A missing confirmation is rejected by the backend when the repository changed.
  • The warning is available in German and English.
  • Existing archives and repositories are not modified by the confirmation flow.
  • Focused frontend and backend tests cover unchanged, confirmed, cancelled, and bypass-attempt cases.

borg-codex-bot avatar Sep 02 '26 10:09 borg-codex-bot