quak backup no longer refreshes its library on a timer (closes #183) #190

Merged
clawbot merged 2 commits from issue-183-backup-no-timed-refresh into next 2026-10-14 04:10:15 +02:00
Collaborator

#183

quak backup opened its library with the default refresh interval of 3 seconds, so for its whole run it asked the server for changes every few seconds, and each of those refreshes started another ML data pass. It now opens its library with refreshIntervalSeconds: Infinity, so the only refreshes are the ones it waits for as it starts.

The library did not accept Infinity before: setTimeout turns a delay that large into 1 ms, so it would have refreshed without pause. scheduleNext now starts no timer for it. The option's comment and the README's LibraryOptions table say so, and "Backup layout" says the backup asks for changes only as it starts.

The new test in test/cli/commands.test.ts runs backupCommand with the real session loader and client against a fake of the Ente HTTP API serving one encrypted album and photo. It holds the download open while a fake setTimeout clock moves on two hours, and expects two /collections/v2 requests: one as the library opens onto the empty cache, one the backup waits for.

Judgement call: Infinity rather than the 3600 the read commands use, because a backup can run for hours and 3600 would still refresh once an hour.
Judgement call: the test raises the download's idle deadline past the two hours it holds the download, or quak would give the download up as stalled.

Model: opus-5-5

https://git.eeqj.de/sneak/quak/issues/183 `quak backup` opened its library with the default refresh interval of 3 seconds, so for its whole run it asked the server for changes every few seconds, and each of those refreshes started another ML data pass. It now opens its library with `refreshIntervalSeconds: Infinity`, so the only refreshes are the ones it waits for as it starts. The library did not accept `Infinity` before: `setTimeout` turns a delay that large into 1 ms, so it would have refreshed without pause. `scheduleNext` now starts no timer for it. The option's comment and the README's `LibraryOptions` table say so, and "Backup layout" says the backup asks for changes only as it starts. The new test in `test/cli/commands.test.ts` runs `backupCommand` with the real session loader and client against a fake of the Ente HTTP API serving one encrypted album and photo. It holds the download open while a fake `setTimeout` clock moves on two hours, and expects two `/collections/v2` requests: one as the library opens onto the empty cache, one the backup waits for. Judgement call: `Infinity` rather than the 3600 the read commands use, because a backup can run for hours and 3600 would still refresh once an hour. Judgement call: the test raises the download's idle deadline past the two hours it holds the download, or quak would give the download up as stalled. Model: opus-5-5
clawbot added the needs-review label 2026-10-14 02:29:22 +02:00
clawbot self-assigned this 2026-10-14 02:29:22 +02:00
Author
Collaborator

Review passed.
Model: opus-5-5

Review passed. Model: opus-5-5
clawbot added 2 commits 2026-10-14 03:50:50 +02:00
A backup whose single download is held open while the clock moves on two
hours must make only the two refreshes it waits for, counted at the fake
server's /collections/v2. It runs the real session loader and client
against a fake of the Ente HTTP API serving one encrypted album and photo.
This fails until the backup's library stops refreshing on a timer.

Model: opus-5-5
The backup opened its library with the default 3-second refresh interval,
so for its whole run it asked the server for changes every few seconds,
and each refresh started another ML data pass. It now opens it with
refreshIntervalSeconds: Infinity. The library takes Infinity as no
background timer, since setTimeout would turn it into 1 ms. A refresh
interval of 3600, as the read commands use, would still refresh once an
hour in a backup that runs for hours.

Model: opus-5-5
clawbot force-pushed issue-183-backup-no-timed-refresh from e8c4c9e2ee to 1dd616f5ce 2026-10-14 03:50:50 +02:00 Compare
clawbot merged commit 288825b11a into next 2026-10-14 04:10:15 +02:00
clawbot deleted branch issue-183-backup-no-timed-refresh 2026-10-14 04:10:17 +02:00
clawbot removed the needs-review label 2026-10-14 04:10:17 +02:00
Sign in to join this conversation.