You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
backups: a pre-restore snapshot sorts as "newest" forever, masking copy failures #105
backup::snapshots_in orders snapshots by file name. restore sets the old database aside as consolebook-prerestore-<stamp>.db. Because p sorts after 2, that file sorts after every consolebook-<stamp>.db, whatever its time. After any restore, every consumer of "the newest snapshot" picks the pre-restore file:
backup_copy::catch_up copies the pre-restore database to the off-server share. It is the one the operator just replaced.
/api/backups/status and the administrator's home report the copy as current while the share holds that file, even when every later daily copy fails. That hides exactly the failure ADR 0024 exists to surface.
prune_in treats the pre-restore file as the newest, so retention removes real daily backups ahead of it.
doctor names it as the latest snapshot.
Observed in the #94 upgrade drill on 0.1.0: after restore, doctor printed backups 3 snapshot(s), latest consolebook-prerestore-20261014T214629Z.db. The two daily snapshots were newer by content but older by name.
Scope
In scope:
Order snapshots by the UTC stamp in their name, falling back to the name.
Tests covering a pre-restore snapshot older than a later daily backup, for listing, copy status, catch-up, and retention.
Out of scope:
Renaming existing files.
Acceptance criteria
After a restore and a later backup, the later backup is the newest everywhere, and copy status reflects whether that one was copied.
Retention removes the chronologically oldest snapshots.
Expected proof
cargo test --workspace with the new ordering tests, plus a negative control on the old ordering.
Activity
docs: changelog entry for #105