runBackup must not crash on symlink failure, and must repair partial originals
#8
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The README sells
quak backupas resilient: "per-file errors are logged and the runcontinues", and the Rationale section calls out the Go CLI crashing on a single failed
download as the reason quak exists. Two paths break that promise.
symlinkSyncis unguarded.src/backup.ts:137-140callssymlinkSyncoutside theper-file
try/catch. It throws — aborting the entire backup — on a name collision, on afilesystem without symlink support, or on Windows without the required privilege. The
collection name and file title that make up the link path both come from server-controlled
decrypted metadata, so a single awkwardly named album kills the run.
A partially written original is never repaired.
src/backup.ts:91skips any existingfile with
size > 0. A file left behind by a killed or interrupted run is thereforetreated as complete forever. (Atomic writes are handled in the download-layer issue; this
issue covers the pre-existing files that atomicity does not retroactively fix, and the
skip heuristic itself.)
Definition of done
BackupResult's error list with thecollection, file ID and the underlying reason, and the run continues to the next file.
runBackupnever throws for any per-file or per-collection condition; it reports throughits result value. The process exit code contract documented in the README is unchanged.
complete, not merely non-empty. Compare against the size the server reports where one is
available; where it is not, document in a code comment why the chosen check is sufficient.
error; a second run over a complete backup still downloads nothing; a truncated
pre-existing original is re-downloaded rather than skipped; a run with a mix of successes
and failures reports both and exits non-zero.
make checkgreen.TODO.mdupdated in the same commit.Depends on
The download atomic-write issue, which this builds on.