Test the live-photo hash check error paths (closes #117) #118

Merged
clawbot merged 1 commits from issue-109-livephoto-errors into next2 2026-09-23 06:56:15 +02:00
Collaborator

Closes #117.

Adds three downloadFile tests for the live-photo hash check's error paths, which #98 left untested:

  • a ZIP that is not readable: the first entry's compression method (bytes 8-9 of its local header) is set to 99, a method fflate does not know. The test checks the error names file 999, nothing is stored, and there is one request (no retry).
  • a ZIP with no image entry, and one with no video entry: each checks the "does not hold both an image and a video" error for file 999 and that nothing is stored.

Each test fails when its check in livePhotoHasher (src/download/index.ts) is removed. Without the missing-entry check the download still fails, but with the general hash-mismatch error, so these tests match the specific message. No source change.

Disclosure: the task I was given named #109 (the fix-missing-thumbnails issue), but its description and branch name match #117. I implemented 117 and left 109 alone. The branch keeps the name issue-109-livephoto-errors from that instruction.

make check passed.

Model: opus-5-5

Closes https://git.eeqj.de/sneak/quak/issues/117. Adds three `downloadFile` tests for the live-photo hash check's error paths, which https://git.eeqj.de/sneak/quak/pulls/98 left untested: - a ZIP that is not readable: the first entry's compression method (bytes 8-9 of its local header) is set to 99, a method fflate does not know. The test checks the error names file 999, nothing is stored, and there is one request (no retry). - a ZIP with no image entry, and one with no video entry: each checks the "does not hold both an image and a video" error for file 999 and that nothing is stored. Each test fails when its check in `livePhotoHasher` (`src/download/index.ts`) is removed. Without the missing-entry check the download still fails, but with the general hash-mismatch error, so these tests match the specific message. No source change. Disclosure: the task I was given named https://git.eeqj.de/sneak/quak/issues/109 (the `fix-missing-thumbnails` issue), but its description and branch name match https://git.eeqj.de/sneak/quak/issues/117. I implemented 117 and left 109 alone. The branch keeps the name `issue-109-livephoto-errors` from that instruction. `make check` passed. Model: opus-5-5
clawbot added the needs-review label 2026-09-23 06:20:30 +02:00
clawbot self-assigned this 2026-09-23 06:20:30 +02:00
Author
Collaborator

PASS on 77649ce rebased onto next2 c19943a.

Non-blocking: the test comment at test/download/download.test.ts:1752 says compression method 99 is "one no reader knows"; 99 is the WinZip AES marker that many readers handle. "a method fflate does not know", as the PR body says, is accurate.

Model: opus-5-5

PASS on `77649ce` rebased onto `next2` `c19943a`. Non-blocking: the test comment at `test/download/download.test.ts:1752` says compression method 99 is "one no reader knows"; 99 is the WinZip AES marker that many readers handle. "a method fflate does not know", as the PR body says, is accurate. Model: opus-5-5
clawbot added needs-rebase and removed needs-review labels 2026-09-23 06:36:22 +02:00
clawbot added 1 commit 2026-09-23 06:53:09 +02:00
Three downloadFile tests cover a live photo whose ZIP names an unknown
compression method, one whose ZIP has no image entry and one with no
video entry. Each checks that nothing is stored and the error names the
file ID; the unreadable ZIP is also checked not to be retried. Each test
fails when its check in livePhotoHasher is removed.

Model: opus-5-5
clawbot force-pushed issue-109-livephoto-errors from 77649ce266 to d5d7908ff6 2026-09-23 06:53:09 +02:00 Compare
clawbot added needs-review and removed needs-rebase labels 2026-09-23 06:53:14 +02:00
clawbot merged commit c24c4dda4f into next2 2026-09-23 06:56:15 +02:00
clawbot deleted branch issue-109-livephoto-errors 2026-09-23 06:56:16 +02:00
Sign in to join this conversation.