quak get FILE and quak get-thumb FILE fetch the files of every new or changed collection before they fetch the one file asked for. On an empty cache that is every collection in the account. This is the same over-fetching as #217, and this fix builds on that one.
Where. Both commands call freshFile in src/cli-read.ts, which awaits lib.fresh(): a full refresh. They then look the file up in the refreshed store. The content cache finds a file's record in the store by its ID before it fetches the original or the thumbnail.
freshFile(lib, fileID) makes one collections request through lib.freshCollections(). Then it fetches one collection's files at a time, with the method #217 adds, and stops at the first collection that holds the file.
It tries first the collections the cache already says hold the file, then the rest in the server's order. A cache that knows the file then costs one collection's files. An empty cache costs at most every collection, as today.
The content cache gets a plain way to fetch the original or thumbnail of a record it is given, instead of one it looks up in the store. get and get-thumb use it with the record freshFile found.
Output, default file names, live photos, exit codes and the "File N not found" message stay the same. Nothing is written to the saved cache of collections and files.
Do not start before the PR for #217 is merged to next.
Test. With quak's real Client against the fake server in test/ente-server.ts, holding at least three collections: getCommand for a file in the second sends no /collections/v2/diff request for the third. A second test asks for a file the cache already holds in the last collection, and asserts no diff request went to any other collection.
Done when both tests pass, get and get-thumb stop fetching collections once the file is found, and nothing they print changes.
Model: opus-5-5
`quak get FILE` and `quak get-thumb FILE` fetch the files of every new or changed collection before they fetch the one file asked for. On an empty cache that is every collection in the account. This is the same over-fetching as https://git.eeqj.de/sneak/quak/issues/217, and this fix builds on that one.
**Where.** Both commands call `freshFile` in `src/cli-read.ts`, which awaits `lib.fresh()`: a full refresh. They then look the file up in the refreshed store. The content cache finds a file's record in the store by its ID before it fetches the original or the thumbnail.
**Fix.** It stores nothing, like the fix for https://git.eeqj.de/sneak/quak/issues/217.
- `freshFile(lib, fileID)` makes one collections request through `lib.freshCollections()`. Then it fetches one collection's files at a time, with the method https://git.eeqj.de/sneak/quak/issues/217 adds, and stops at the first collection that holds the file.
- It tries first the collections the cache already says hold the file, then the rest in the server's order. A cache that knows the file then costs one collection's files. An empty cache costs at most every collection, as today.
- The content cache gets a plain way to fetch the original or thumbnail of a record it is given, instead of one it looks up in the store. `get` and `get-thumb` use it with the record `freshFile` found.
- Output, default file names, live photos, exit codes and the "File N not found" message stay the same. Nothing is written to the saved cache of collections and files.
- Do not start before the PR for https://git.eeqj.de/sneak/quak/issues/217 is merged to `next`.
**Test.** With quak's real `Client` against the fake server in `test/ente-server.ts`, holding at least three collections: `getCommand` for a file in the second sends no `/collections/v2/diff` request for the third. A second test asks for a file the cache already holds in the last collection, and asserts no diff request went to any other collection.
**Done when** both tests pass, `get` and `get-thumb` stop fetching collections once the file is found, and nothing they print changes.
Model: opus-5-5
clawbot
self-assigned this 2026-10-26 00:15:46 +01:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
quak get FILEandquak get-thumb FILEfetch the files of every new or changed collection before they fetch the one file asked for. On an empty cache that is every collection in the account. This is the same over-fetching as #217, and this fix builds on that one.Where. Both commands call
freshFileinsrc/cli-read.ts, which awaitslib.fresh(): a full refresh. They then look the file up in the refreshed store. The content cache finds a file's record in the store by its ID before it fetches the original or the thumbnail.Fix. It stores nothing, like the fix for #217.
freshFile(lib, fileID)makes one collections request throughlib.freshCollections(). Then it fetches one collection's files at a time, with the method #217 adds, and stops at the first collection that holds the file.getandget-thumbuse it with the recordfreshFilefound.next.Test. With quak's real
Clientagainst the fake server intest/ente-server.ts, holding at least three collections:getCommandfor a file in the second sends no/collections/v2/diffrequest for the third. A second test asks for a file the cache already holds in the last collection, and asserts no diff request went to any other collection.Done when both tests pass,
getandget-thumbstop fetching collections once the file is found, and nothing they print changes.Model: opus-5-5