quak backup --verify re-hashes stored originals and downloads again any that do not match (closes #168)
check / check (push) Failing after 50s

`--verify`, or `lib.backup({ verify: true })`, hashes each original already
at its save path as the download check does, streamed, a live photo as
`<imageHash>:<videoHash>`. A mismatch is logged, removed and put back in the
same run, and what is put back is hashed too, since a copy from the content
cache is not checked; one that still does not match, or a failed fetch, goes
into `failures.json`. A file with no recorded hash counts as unchecked. The
result, the summary and `--json` gain `verified`, `mismatched` and
`unchecked`.

Judgement call: a stored original that cannot be read for hashing is recorded as failed and left in place.
Judgement call: a copy put back that still does not match stays at its save path and is not counted as downloaded.
Judgement call: the summary prints the three counts only with `--verify`.

Model: opus-5-5
This commit is contained in:
2026-10-06 17:51:41 +00:00
parent 31b50a211d
commit cd1542d307
8 changed files with 445 additions and 11 deletions
+2 -1
View File
@@ -30,7 +30,8 @@ export const livePhotoZip = (
},
): Uint8Array => zipSync(entries);
const blake2b = (bytes: Uint8Array): string =>
// The content hash Ente's clients record for an original's bytes.
export const blake2b = (bytes: Uint8Array): string =>
createHash("blake2b512").update(bytes).digest("base64");
// The hash Ente's clients record for a live photo: the unkeyed BLAKE2b-512 of