fix(desktop): send delivery originals without re-hashing XMP-rewritten files
ci / rust (pull_request) Successful in 4m47s
ci / typescript (pull_request) Successful in 10m46s

After work-folder XMP writes the JPEG hash no longer matches the index.
Trying local_original first re-hashed every multi-MB file and stalled the
queue that was waiting on those uploads.
This commit is contained in:
spark committed 2026-11-14 17:57:43 +00:00
1 parent 4644ee82f2
commit 9f5532c737
1 file changed
+7 -4
+7 -4
View File
@@ -110,11 +110,14 @@ export class OriginalSender {
}
private async sendOne(need: OriginalNeed): Promise<void> {
const exact = await withTimeout(localOriginal(need.sha256), ORIGINAL_IPC_MS);
let bytes: ArrayBuffer | null = exact && exact !== "timeout" ? exact : null;
// Prefer the path that skips a full-file SHA (XMP / IPTC rewrites change the hash but keep the same
// pixels). Trying `local_original` first re-hashes multi‑MB JPEGs only to fail, and stalls the
// delivery queue that is waiting on these uploads.
const changed = await withTimeout(localOriginalChanged(need.sha256), ORIGINAL_IPC_MS);
let bytes: ArrayBuffer | null = changed && changed !== "timeout" ? changed : null;
if (!bytes) {
const changed = await withTimeout(localOriginalChanged(need.sha256), ORIGINAL_IPC_MS);
bytes = changed && changed !== "timeout" ? changed : null;
const exact = await withTimeout(localOriginal(need.sha256), ORIGINAL_IPC_MS);
bytes = exact && exact !== "timeout" ? exact : null;
}
if (!bytes) return;
try {