quak collections reads the collection list alone #214

Merged
clawbot merged 1 commits from fix/210-collections-hang into next 2026-10-18 19:01:35 +02:00
Collaborator

Fixes #210. The cause is the one its plan names: on an empty cache the read commands opened their library with a refresh that fetched and decrypted the files of every collection, one after another, printing nothing and storing nothing until it had them all, so a stopped run started over; fresh() then ran a second refresh.

What changed:

  • lib.freshCollections() in src/library/index.ts: the collection list from one request, with no collection's files. It stores nothing, because a collection stored without its files would look up to date to the next refresh, which would then never fetch them.
  • refreshOnOpen: false opens a library without a refresh. The read commands use it, so each makes only the refresh it asks for, and collections makes none.
  • A refresh sends a "progress" event after each collection whose files it fetched. files, get, get-thumb, backup-metadata and the two helpers print it on stderr as Fetched the files of 3 of 120 collections; stdout is unchanged.
  • README "CLI surface", "Opening a library" and the fresh reads section say so.

A reader might trip over this: collections no longer fills the cache, so the first files after it still does the full refresh.

Judgement call: with --json, files and the helpers do not print this progress, as backup and the helpers print none of theirs under --json.
Judgement call: collections prints nothing on stderr; it waits on one request, not a refresh.
Not done: quak backup waits on the same refresh and prints no such progress; the plan names only the read commands.
Unverified: tested against the fake server only, not a live account.

Model: opus-5-5

Fixes https://git.eeqj.de/sneak/quak/issues/210. The cause is the one its plan names: on an empty cache the read commands opened their library with a refresh that fetched and decrypted the files of every collection, one after another, printing nothing and storing nothing until it had them all, so a stopped run started over; `fresh()` then ran a second refresh. What changed: - `lib.freshCollections()` in `src/library/index.ts`: the collection list from one request, with no collection's files. It stores nothing, because a collection stored without its files would look up to date to the next refresh, which would then never fetch them. - `refreshOnOpen: false` opens a library without a refresh. The read commands use it, so each makes only the refresh it asks for, and `collections` makes none. - A refresh sends a `"progress"` event after each collection whose files it fetched. `files`, `get`, `get-thumb`, `backup-metadata` and the two helpers print it on stderr as `Fetched the files of 3 of 120 collections`; stdout is unchanged. - README "CLI surface", "Opening a library" and the fresh reads section say so. A reader might trip over this: `collections` no longer fills the cache, so the first `files` after it still does the full refresh. Judgement call: with `--json`, `files` and the helpers do not print this progress, as `backup` and the helpers print none of theirs under `--json`. Judgement call: `collections` prints nothing on stderr; it waits on one request, not a refresh. Not done: `quak backup` waits on the same refresh and prints no such progress; the plan names only the read commands. Unverified: tested against the fake server only, not a live account. Model: opus-5-5
clawbot added the needs-review label 2026-10-18 18:30:33 +02:00
clawbot added 1 commit 2026-10-18 18:30:33 +02:00
On an empty cache the read commands opened their library with a refresh
that fetched and decrypted the files of every collection in turn,
printing nothing and storing nothing until it had them all, so `quak
collections` seemed to hang on a large account. The new
`lib.freshCollections()` is the fresh read of the collection list alone:
one request, and nothing stored, so a later refresh still fetches every
collection's files. The read commands open their library with the new
`refreshOnOpen: false` and make only the refresh they ask for. A refresh
sends a "progress" event after each collection whose files it fetched;
the commands that wait on one print it on stderr, except with `--json`.

Model: opus-5-5
clawbot self-assigned this 2026-10-18 18:30:36 +02:00
Author
Collaborator

Review passed.
Model: opus-5-5

Review passed. Model: opus-5-5
clawbot merged commit 982b878d69 into next 2026-10-18 19:01:35 +02:00
clawbot deleted branch fix/210-collections-hang 2026-10-18 19:01:36 +02:00
Sign in to join this conversation.