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

Refresh Browse & Restore archive state after backups and repository changes

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

Browse & Restore retains an outdated archive list and selection after a backup or a change to the selected job's repository. New archives are missing, and archives from the previous repository can still be offered for the same permanent job ID.

Related implementation PR: #494. Found during external acceptance testing of #486; the job migration itself completed successfully.

Evidence

  • Reported Unraid version: 7.3.2.
  • Actual test-channel version in the support manifest and startup log: 2026.09.09.1010. The tester's 2026.09.07.0935 was apparently the starting version.
  • On 2026-09-10, a manual backup to repository 1 at 11:29 and a scheduled backup at 11:34 both succeeded. Browse & Restore initially continued to show only the 11:29 archive.
  • After switching the same job to repository 2, a scheduled backup at 11:39 succeeded there. The next file-list request still selected the 11:29 archive from repository 1.
  • The service log contains no intervening archive-list request for this job between 11:30 and that failing request at 11:39:39.
  • An isolated execution of the existing JavaScript with a mocked DOM/API reproduces the stale state: restoreInit() refreshes jobs and their current repository, but retains the previous archive list and selection without requesting fresh archives.

Reproduction

  1. Create a dedicated test job and test repository 1, then run a backup.
  2. Open Browse & Restore and select that job/archive.
  3. Run another backup, then return to Browse & Restore.
  4. Edit the same job to use test repository 2, run a backup, and return to Browse & Restore again.
  5. Observe the outdated archive list or an archive offered from repository 1.

Required behavior and acceptance

  • Refresh the relevant archive list when returning to or reselecting a job after backups and repository changes, without requiring a browser reload or service restart.
  • Invalidate archive, file and precheck selections when their repository/archive context is no longer valid, even when the permanent job ID is unchanged.
  • Do not apply an outdated asynchronous response to a newer job/repository selection.
  • Preserve the current single-repository job model and existing navigation layout.
  • Cover backup completion, repository 1 -> repository 2 -> repository 1, unchanged job ID, and job rename in focused tests and repeat the tester's workflow.

Scope boundary

Do not change Borg retention or move/merge archives between repositories. Later removal of the 11:34 and 11:57 test archives is explicitly recorded as normal Borg prune behavior. Error presentation and the loading indicator are tracked separately. The additional repository-change confirmation feature remains in #452.

Relevant code: ui/js/pages/restore.js (restoreInit, restoreLoadArchives) and navigation in ui/js/core/app-core.js.

User impact: fresh backups and the correct current repository must be visible without restarting the application. Release note required. This issue is open work for PR #494, not a completed fix.

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

Implemented in 9635feb: reopening Browse & Restore refreshes the selected job and its current archive list. Reselecting a job also loads fresh archives. Source changes clear old file selections, confirmations and prechecks; late responses from the previous source cannot restore them.

Verification: executable UI tests cover additional backups, repository changes, rename, removed jobs and response races. A local HTTP test using real Borg 1.4.5 returned the expected archive lists after new backups and repository 1 -> repository 2 -> repository 1, with an unchanged job UUID.

Retest: create manual and scheduled backups in a test repository, return to Browse & Restore without restarting the plugin, switch the test job between two repositories, then rename it and repeat. Confirm that only archives in the current repository are selectable. Native Borg retention still applies to intermediate same-day backups.

Included in PR #494, test-channel version 2026.09.10.1549. Final source: 366ebb4f448d2c19bbe50636310926e28b11278b. The final pushed commit passed the full preflight once: 935 tests passed, none skipped, plus Python syntax checks.

Test-channel manifest. Existing migrated test installations can update directly; these fixes add no new migration. Keep this issue open pending the external retest and PR acceptance.

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