Refresh before backup-metadata and the thumbnail helpers answer (closes #100) #123

Merged
clawbot merged 1 commits from issue-100-fresh-reads into next2 2026-09-23 08:11:37 +02:00
Collaborator

Closes #100.

backup-metadata, helper list-missing-thumbnails and helper fix-missing-thumbnails now await lib.fresh() right after opening the library, the same way collections, files, get and get-thumb already refresh first. With an existing cache the library's first refresh runs in the background, so before this change these commands answered from whatever the cache held. Now a file added since the cache was written is included, and a failed refresh throws, which run in src/cli-run.ts prints as one quak: MESSAGE line with exit 1.

The refresh is called in the command functions, not inside runMetadataBackup or the thumbnail functions, so fix-missing-thumbnails without --file refreshes once, not twice.

Tests: each command is run after collections has written the cache, against a fake server that has since added a file to a collection (with the collection's update time advanced, as the real server does, since the library only re-lists a collection whose update time moved). A second case makes the refresh fail and checks all three reject without writing output. All four fail with the source change reverted.

README CLI section lists the three commands among those that refresh first and says a failed refresh exits 1. TODO.md updated.

Model: opus-5-5

Closes https://git.eeqj.de/sneak/quak/issues/100. `backup-metadata`, `helper list-missing-thumbnails` and `helper fix-missing-thumbnails` now await `lib.fresh()` right after opening the library, the same way `collections`, `files`, `get` and `get-thumb` already refresh first. With an existing cache the library's first refresh runs in the background, so before this change these commands answered from whatever the cache held. Now a file added since the cache was written is included, and a failed refresh throws, which `run` in `src/cli-run.ts` prints as one `quak: MESSAGE` line with exit 1. The refresh is called in the command functions, not inside `runMetadataBackup` or the thumbnail functions, so `fix-missing-thumbnails` without `--file` refreshes once, not twice. Tests: each command is run after `collections` has written the cache, against a fake server that has since added a file to a collection (with the collection's update time advanced, as the real server does, since the library only re-lists a collection whose update time moved). A second case makes the refresh fail and checks all three reject without writing output. All four fail with the source change reverted. README CLI section lists the three commands among those that refresh first and says a failed refresh exits 1. `TODO.md` updated. Model: opus-5-5
clawbot self-assigned this 2026-09-23 07:52:47 +02:00
clawbot added the needs-review label 2026-09-23 07:52:52 +02:00
Author
Collaborator

PASS on 4c325edc9be21dc10f1c76801f3e4365aad5e77c rebased onto next2 36642f4448954dff2815f1ec4d096229c8fa2834.

Model: opus-5-5

PASS on `4c325edc9be21dc10f1c76801f3e4365aad5e77c` rebased onto `next2` `36642f4448954dff2815f1ec4d096229c8fa2834`. Model: opus-5-5
clawbot added 1 commit 2026-09-23 08:08:02 +02:00
backup-metadata, helper list-missing-thumbnails and helper
fix-missing-thumbnails now await lib.fresh() before reading the library,
as collections, files, get and get-thumb already do. A file added since
the cache was written is included, and a failed refresh is thrown, so
the CLI prints one line and exits 1 instead of answering from a stale
or empty cache. The README lists them among the commands that refresh
first.

Model: opus-5-5
clawbot force-pushed issue-100-fresh-reads from 4c325edc9b to 2e885d54e5 2026-09-23 08:08:02 +02:00 Compare
clawbot merged commit f52c77f155 into next2 2026-09-23 08:11:37 +02:00
clawbot deleted branch issue-100-fresh-reads 2026-09-23 08:11:37 +02:00
Sign in to join this conversation.