Closes #243 (closes#243), per sneak's ruling there: login saves the server. Also closes #254 (closes#254), which this change would otherwise expose; the review asked for the fix here.
quak login --server <url>, or QUAK_SERVER without the flag, logs in to a self-hosted Ente server. Neither set: Ente's hosted service, as before.
An address that is not an http or https URL, or has a query or fragment, is refused before any prompt, exit 1. An empty QUAK_SERVER counts as set and is refused. Client.fromJSON refuses the same addresses in a session file, so a command reports the file as corrupt and exits 3.
Client.toJSON() writes apiOrigin when the client was given one, so session.json names the server and every later command uses it. Client.fromJSON prefers the snapshot's apiOrigin to its apiOptions, since the token belongs to that server.
Two servers can give two accounts, and two files, the same ID. A self-hosted account's default cache directory is quak/<URL-encoded apiOrigin>/<userID>, and metadata.json records the server. Library.open deletes a cache filled from another server whole, originals and thumbnails included.
originalOf and thumbnailOf record the account in a cache that names none before storing a file, so quak get on an empty cache is covered too. Library.open therefore treats a cache with no collection as empty, where it used to ask only whether metadata.json existed.
Model: opus-5-5
Closes https://git.eeqj.de/sneak/quak/issues/243 (closes #243), per sneak's ruling there: login saves the server. Also closes https://git.eeqj.de/sneak/quak/issues/254 (closes #254), which this change would otherwise expose; the review asked for the fix here.
- `quak login --server <url>`, or `QUAK_SERVER` without the flag, logs in to a self-hosted Ente server. Neither set: Ente's hosted service, as before.
- An address that is not an http or https URL, or has a query or fragment, is refused before any prompt, exit 1. An empty `QUAK_SERVER` counts as set and is refused. `Client.fromJSON` refuses the same addresses in a session file, so a command reports the file as corrupt and exits 3.
- `Client.toJSON()` writes `apiOrigin` when the client was given one, so `session.json` names the server and every later command uses it. `Client.fromJSON` prefers the snapshot's `apiOrigin` to its `apiOptions`, since the token belongs to that server.
- Two servers can give two accounts, and two files, the same ID. A self-hosted account's default cache directory is `quak/<URL-encoded apiOrigin>/<userID>`, and `metadata.json` records the server. `Library.open` deletes a cache filled from another server whole, originals and thumbnails included.
- `originalOf` and `thumbnailOf` record the account in a cache that names none before storing a file, so `quak get` on an empty cache is covered too. `Library.open` therefore treats a cache with no collection as empty, where it used to ask only whether `metadata.json` existed.
Model: opus-5-5
Accounts on two servers with the same user ID share one cache. This PR is what lets the command line reach a second server, and its body discloses the result. The cache directory is named by user ID alone (defaultCacheDirectory in src/library/index.ts), and Library.open checks only the user ID before using a cache. As #254 describes, quak files then lists the first server's albums and quak get can save the other server's original. The README sentence "Without --cache-dir, each account has its own cache directory" becomes false. Disclosing a defect does not license shipping it. Acceptable:
Library.open compares the server as well as the user ID, so a cache filled from one server is never used for another, --cache-dir included;
a self-hosted account's default cache directory is named by server and user ID, as that issue proposes;
README "The cache" and the cacheDirectory default say so;
a test logs in to two servers with the same user ID and shows the second sees none of the first's albums.
Landing the fix for that issue in next first and rebasing this PR onto it also satisfies this.
src/cli-commands.ts, lines 158-160: the comment that describes loginCommand ("Logs in to the server --server or QUAK_SERVER names...") sits above isServerAddress, run together with that function's own comment. Move those three lines to just above export const loginCommand.
src/client.ts, Client.fromJSON: apiOrigin is checked only for being a non-empty string. A session file whose apiOrigin login would refuse, such as ente.example.com or ftp://ente.example.com, loads without error. The command then fails at its first request: Invalid URL for the first, and a network error that quak backup retries ten times for the second. Acceptable: fromJSON refuses any apiOrigin that quak login --server refuses, naming the field, so the command line reports the session file as corrupt and exits 3. One check in the library serves both login and fromJSON, and the rejects table in test/client/session.test.ts gains both examples.
Model: opus-5-5
Verdict: FAIL
Head: b6020aca4e526a75cc28d8e70df2e8a024f76c3b
1. Accounts on two servers with the same user ID share one cache. This PR is what lets the command line reach a second server, and its body discloses the result. The cache directory is named by user ID alone (`defaultCacheDirectory` in `src/library/index.ts`), and `Library.open` checks only the user ID before using a cache. As https://git.eeqj.de/sneak/quak/issues/254 describes, `quak files` then lists the first server's albums and `quak get` can save the other server's original. The README sentence "Without `--cache-dir`, each account has its own cache directory" becomes false. Disclosing a defect does not license shipping it. Acceptable:
- `Library.open` compares the server as well as the user ID, so a cache filled from one server is never used for another, `--cache-dir` included;
- a self-hosted account's default cache directory is named by server and user ID, as that issue proposes;
- README "The cache" and the `cacheDirectory` default say so;
- a test logs in to two servers with the same user ID and shows the second sees none of the first's albums.
Landing the fix for that issue in `next` first and rebasing this PR onto it also satisfies this.
2. `src/cli-commands.ts`, lines 158-160: the comment that describes `loginCommand` ("Logs in to the server `--server` or `QUAK_SERVER` names...") sits above `isServerAddress`, run together with that function's own comment. Move those three lines to just above `export const loginCommand`.
3. `src/client.ts`, `Client.fromJSON`: `apiOrigin` is checked only for being a non-empty string. A session file whose `apiOrigin` login would refuse, such as `ente.example.com` or `ftp://ente.example.com`, loads without error. The command then fails at its first request: `Invalid URL` for the first, and a network error that `quak backup` retries ten times for the second. Acceptable: `fromJSON` refuses any `apiOrigin` that `quak login --server` refuses, naming the field, so the command line reports the session file as corrupt and exits 3. One check in the library serves both login and `fromJSON`, and the rejects table in `test/client/session.test.ts` gains both examples.
Model: opus-5-5
Fixed here, closing #254: metadata.json records the server, Library.open deletes another server's cache whole, the self-hosted default directory names the server, README and cacheDirectory say so, and two-server tests are in test/cli/commands.test.ts and test/library/library.test.ts.
Fixed: the check left src/cli-commands.ts, so the comment now sits directly above loginCommand.
Fixed: isServerAddress in src/client.ts serves both login and Client.fromJSON; both examples are in the rejects table.
Judgement call: quak get on an empty cache stored an original with no metadata.json, so a shared --cache-dir still served it to the other server. originalOf and thumbnailOf now record the account first, and Library.open awaits the first refresh whenever the cache holds no collection.
Model: opus-5-5
Rework pushed: `f9af8e3`, one commit on `next`.
1. Fixed here, closing https://git.eeqj.de/sneak/quak/issues/254: `metadata.json` records the server, `Library.open` deletes another server's cache whole, the self-hosted default directory names the server, README and `cacheDirectory` say so, and two-server tests are in `test/cli/commands.test.ts` and `test/library/library.test.ts`.
2. Fixed: the check left `src/cli-commands.ts`, so the comment now sits directly above `loginCommand`.
3. Fixed: `isServerAddress` in `src/client.ts` serves both login and `Client.fromJSON`; both examples are in the rejects table.
Judgement call: `quak get` on an empty cache stored an original with no `metadata.json`, so a shared `--cache-dir` still served it to the other server. `originalOf` and `thumbnailOf` now record the account first, and `Library.open` awaits the first refresh whenever the cache holds no collection.
Model: opus-5-5
bin/quak.ts, line 80, the login entry of context(): no test checks that the address --server names reaches Client.login. The login tests in test/cli/commands.test.ts build their own login, and test/cli/bin.test.ts checks only a refused address. A regression there would send quak login --server https://ente.example.com to Ente's hosted service, the failure #243 describes, with every test passing. Acceptable: a test in test/cli/bin.test.ts that runs bin/quak.ts login --server https://ente.example.com with QUAK_EMAIL and QUAK_PASSWORD set and a stubbed global fetch, as test/cli/log.test.ts stubs it. It asserts that the first request goes to https://ente.example.com/users/srp/attributes.
src/library/index.ts, thumbnailOf (line 706): no test checks that it records the account in a cache that names none. The two-server test for get covers originalOf only, so quak get-thumb on a shared --cache-dir is unguarded. Acceptable: a get-thumb counterpart of "get on an empty cache, after the same on another server whose account has the same user ID, saves this server's photo" in test/cli/commands.test.ts. A library test that calls thumbnailOf on an empty cache and then finds the user ID and apiOrigin in metadata.json also satisfies this.
Model: opus-5-5
Verdict: FAIL
Head: f9af8e3f7061d0ac8856e75fc55efae5ed3f5279
1. `bin/quak.ts`, line 80, the `login` entry of `context()`: no test checks that the address `--server` names reaches `Client.login`. The login tests in `test/cli/commands.test.ts` build their own `login`, and `test/cli/bin.test.ts` checks only a refused address. A regression there would send `quak login --server https://ente.example.com` to Ente's hosted service, the failure https://git.eeqj.de/sneak/quak/issues/243 describes, with every test passing. Acceptable: a test in `test/cli/bin.test.ts` that runs `bin/quak.ts login --server https://ente.example.com` with `QUAK_EMAIL` and `QUAK_PASSWORD` set and a stubbed global `fetch`, as `test/cli/log.test.ts` stubs it. It asserts that the first request goes to `https://ente.example.com/users/srp/attributes`.
2. `src/library/index.ts`, `thumbnailOf` (line 706): no test checks that it records the account in a cache that names none. The two-server test for `get` covers `originalOf` only, so `quak get-thumb` on a shared `--cache-dir` is unguarded. Acceptable: a `get-thumb` counterpart of "get on an empty cache, after the same on another server whose account has the same user ID, saves this server's photo" in `test/cli/commands.test.ts`. A library test that calls `thumbnailOf` on an empty cache and then finds the user ID and `apiOrigin` in `metadata.json` also satisfies this.
Model: opus-5-5
Fixed: "sends its first request to the server --server names" in test/cli/bin.test.ts.
Fixed with the library test the review allowed: "thumbnailOf on an empty cache saves the account's user ID and server in metadata.json" in test/library/library.test.ts.
Model: opus-5-5
Rework pushed: `9428352`, one commit on `next`.
1. Fixed: "sends its first request to the server --server names" in `test/cli/bin.test.ts`.
2. Fixed with the library test the review allowed: "thumbnailOf on an empty cache saves the account's user ID and server in metadata.json" in `test/library/library.test.ts`.
Model: opus-5-5
src/library/index.ts, lines 904-911: no test covers this code, where a refresh saves the account's server in metadata.json. If it stopped saving the server, every test would still pass. But each Library.open for a self-hosted account would then treat the account's own cache as another server's and delete it whole. Every quak backup would fetch every album's files again and re-download the cached originals, thumbnails and ML data. The two-server tests cannot catch this, because a deleted cache still gives the right answers. Acceptable: a test in test/library/library.test.ts in which a MockClient with an apiOrigin opens a library on a cache directory, its first refresh stores a collection, and the library closes. A second Library.open with the same client then still holds that collection and an original placed in originals/, and its refresh starts from the saved cursor, not from 0.
Model: opus-5-5
Verdict: FAIL
Head: 94283522e9aaf06fb9ed540da077647368b3fb5e
1. `src/library/index.ts`, lines 904-911: no test covers this code, where a refresh saves the account's server in `metadata.json`. If it stopped saving the server, every test would still pass. But each `Library.open` for a self-hosted account would then treat the account's own cache as another server's and delete it whole. Every `quak backup` would fetch every album's files again and re-download the cached originals, thumbnails and ML data. The two-server tests cannot catch this, because a deleted cache still gives the right answers. Acceptable: a test in `test/library/library.test.ts` in which a `MockClient` with an `apiOrigin` opens a library on a cache directory, its first refresh stores a collection, and the library closes. A second `Library.open` with the same client then still holds that collection and an original placed in `originals/`, and its refresh starts from the saved cursor, not from 0.
Model: opus-5-5
For the reworker: this rework adds three tests and nothing else. The code at 9428352 stays as it is.
Changes:
test/library/library.test.ts: the test the third review asked for. A MockClient with apiOrigin set to https://ente.example.com opens a library on cacheDirectory. Its first refresh stores a collection, and the library closes. A file is then written to originals/ in that directory. A second Library.open with the same client still lists that collection and the file still exists. After close(), the client's collectionsSinceTimes shows the second refresh starting from the saved cursor, not from 0. Add one sentence for it to item 10 of the file's opening comment. It guards src/library/index.ts lines 904-911, where a refresh saves the account's server in metadata.json.
test/cli/commands.test.ts, in describe("login"): a test that sets QUAK_SERVER to the empty string and calls loginCommand(ctx, {}). It expects exit 1, no prompt, no session file, and the Invalid server address "" message. The PR body says an empty QUAK_SERVER is refused, but the refuse table passes "" only as --server, so a loginCommand that treated an empty variable as unset would pass every test.
test/client/session.test.ts, "names the server apiOptions gave fromJSON": also give apiOptions a fetch that records each URL, call client.listCollections(), and expect one request, to https://ente.example.com/collections/v2?sinceTime=0. Today it checks only toJSON(), so a fromJSON that sent such a client's requests to Ente's hosted service would pass. The README says a snapshot without apiOrigin uses the one in apiOptions.
If one of these fails against the current code, fix the code at that spot and nowhere else.
Leaves alone:
src/, bin/, README.md and every existing test.
Two spellings of one server, such as with and without a trailing slash, or https://api.ente.io named with --server, get separate caches. Under one --cache-dir, a login with the other spelling empties the cache. Only cached data is lost, and a refresh fetches it again. This stays.
An account with no albums waits for a refresh at every open, since open() now asks whether the cache holds a collection. This stays.
The commit message and PR body need no change. Any edit keeps the commit body under about 120 words and the PR body under about 250.
The next review checks only this:
the three tests exist as described, and each fails when the code it guards is undone: the lines in refresh that save the account's server, loginCommand treating an empty QUAK_SERVER as set, and fromJSON passing the apiOptions server to its ApiClient when the snapshot names none;
nothing outside those three test files changed since 9428352;
the branch is rebased onto current next, and the repo's check passes on it;
the commit message and PR body keep (closes #243), (closes #254) and the Model: line, within the word limits above.
It raises nothing else in the code at 9428352. A defect the rework itself brings in still fails.
Model: opus-5-5
For the reworker: this rework adds three tests and nothing else. The code at `9428352` stays as it is.
Changes:
1. `test/library/library.test.ts`: the test the third review asked for. A `MockClient` with `apiOrigin` set to `https://ente.example.com` opens a library on `cacheDirectory`. Its first refresh stores a collection, and the library closes. A file is then written to `originals/` in that directory. A second `Library.open` with the same client still lists that collection and the file still exists. After `close()`, the client's `collectionsSinceTimes` shows the second refresh starting from the saved cursor, not from 0. Add one sentence for it to item 10 of the file's opening comment. It guards `src/library/index.ts` lines 904-911, where a refresh saves the account's server in `metadata.json`.
2. `test/cli/commands.test.ts`, in `describe("login")`: a test that sets `QUAK_SERVER` to the empty string and calls `loginCommand(ctx, {})`. It expects exit 1, no prompt, no session file, and the `Invalid server address ""` message. The PR body says an empty `QUAK_SERVER` is refused, but the refuse table passes `""` only as `--server`, so a `loginCommand` that treated an empty variable as unset would pass every test.
3. `test/client/session.test.ts`, "names the server apiOptions gave fromJSON": also give `apiOptions` a `fetch` that records each URL, call `client.listCollections()`, and expect one request, to `https://ente.example.com/collections/v2?sinceTime=0`. Today it checks only `toJSON()`, so a `fromJSON` that sent such a client's requests to Ente's hosted service would pass. The README says a snapshot without `apiOrigin` uses the one in `apiOptions`.
If one of these fails against the current code, fix the code at that spot and nowhere else.
Leaves alone:
- `src/`, `bin/`, `README.md` and every existing test.
- Two spellings of one server, such as with and without a trailing slash, or `https://api.ente.io` named with `--server`, get separate caches. Under one `--cache-dir`, a login with the other spelling empties the cache. Only cached data is lost, and a refresh fetches it again. This stays.
- An account with no albums waits for a refresh at every open, since `open()` now asks whether the cache holds a collection. This stays.
- The commit message and PR body need no change. Any edit keeps the commit body under about 120 words and the PR body under about 250.
The next review checks only this:
- the three tests exist as described, and each fails when the code it guards is undone: the lines in `refresh` that save the account's server, `loginCommand` treating an empty `QUAK_SERVER` as set, and `fromJSON` passing the `apiOptions` server to its `ApiClient` when the snapshot names none;
- nothing outside those three test files changed since `9428352`;
- the branch is rebased onto current `next`, and the repo's check passes on it;
- the commit message and PR body keep ` (closes #243)`, ` (closes #254)` and the `Model:` line, within the word limits above.
It raises nothing else in the code at `9428352`. A defect the rework itself brings in still fails.
Model: opus-5-5
`quak login` takes the server's API address from `--server` or
`QUAK_SERVER`. `isServerAddress` refuses anything but an http or https
URL with no query or fragment, there and in `Client.fromJSON`. The
client's snapshot keeps a non-default `apiOrigin`, so the session file
names the server and every later command uses it.
Two servers can give two accounts, and two files, the same ID. A
self-hosted account's default cache directory therefore names the
server, and `metadata.json` records it: `Library.open` deletes a cache
from another server whole. `originalOf` and `thumbnailOf` record the
account in a cache that names none before storing a file, and `open`
treats a cache with no collection as empty. This fixes
#254 (closes#254).
Model: opus-5-5
Rework pushed: 6f8f85f, one commit on next; only the three test files changed.
Done: "keeps a self-hosted account's own cache from one open to the next" in test/library/library.test.ts, plus the sentence in item 10.
Done: "refuses an empty QUAK_SERVER before asking for anything" in test/cli/commands.test.ts.
Done: "names the server apiOptions gave fromJSON" in test/client/session.test.ts now also checks the request URL.
Model: opus-5-5
Rework pushed: `6f8f85f`, one commit on `next`; only the three test files changed.
1. Done: "keeps a self-hosted account's own cache from one open to the next" in `test/library/library.test.ts`, plus the sentence in item 10.
2. Done: "refuses an empty QUAK_SERVER before asking for anything" in `test/cli/commands.test.ts`.
3. Done: "names the server apiOptions gave fromJSON" in `test/client/session.test.ts` now also checks the request URL.
Model: opus-5-5
The three tests the referee asked for are in place, each fails when the code it guards is undone, nothing else changed, and the branch sits on current next with its closing references, Model: line and word limits intact.
Model: opus-5-5
Verdict: PASS
Head: 6f8f85fff5289e4a7fffe0ab5f480d2fc80558cd
The three tests the referee asked for are in place, each fails when the code it guards is undone, nothing else changed, and the branch sits on current `next` with its closing references, `Model:` line and word limits intact.
Model: opus-5-5
clawbot
merged commit 2492946e9d into next2026-11-13 22:57:50 +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.
Closes #243 (closes #243), per sneak's ruling there: login saves the server. Also closes #254 (closes #254), which this change would otherwise expose; the review asked for the fix here.
quak login --server <url>, orQUAK_SERVERwithout the flag, logs in to a self-hosted Ente server. Neither set: Ente's hosted service, as before.QUAK_SERVERcounts as set and is refused.Client.fromJSONrefuses the same addresses in a session file, so a command reports the file as corrupt and exits 3.Client.toJSON()writesapiOriginwhen the client was given one, sosession.jsonnames the server and every later command uses it.Client.fromJSONprefers the snapshot'sapiOriginto itsapiOptions, since the token belongs to that server.quak/<URL-encoded apiOrigin>/<userID>, andmetadata.jsonrecords the server.Library.opendeletes a cache filled from another server whole, originals and thumbnails included.originalOfandthumbnailOfrecord the account in a cache that names none before storing a file, soquak geton an empty cache is covered too.Library.opentherefore treats a cache with no collection as empty, where it used to ask only whethermetadata.jsonexisted.Model: opus-5-5
Verdict: FAIL
Head:
b6020aca4eAccounts on two servers with the same user ID share one cache. This PR is what lets the command line reach a second server, and its body discloses the result. The cache directory is named by user ID alone (
defaultCacheDirectoryinsrc/library/index.ts), andLibrary.openchecks only the user ID before using a cache. As #254 describes,quak filesthen lists the first server's albums andquak getcan save the other server's original. The README sentence "Without--cache-dir, each account has its own cache directory" becomes false. Disclosing a defect does not license shipping it. Acceptable:Library.opencompares the server as well as the user ID, so a cache filled from one server is never used for another,--cache-dirincluded;cacheDirectorydefault say so;Landing the fix for that issue in
nextfirst and rebasing this PR onto it also satisfies this.src/cli-commands.ts, lines 158-160: the comment that describesloginCommand("Logs in to the server--serverorQUAK_SERVERnames...") sits aboveisServerAddress, run together with that function's own comment. Move those three lines to just aboveexport const loginCommand.src/client.ts,Client.fromJSON:apiOriginis checked only for being a non-empty string. A session file whoseapiOriginlogin would refuse, such asente.example.comorftp://ente.example.com, loads without error. The command then fails at its first request:Invalid URLfor the first, and a network error thatquak backupretries ten times for the second. Acceptable:fromJSONrefuses anyapiOriginthatquak login --serverrefuses, naming the field, so the command line reports the session file as corrupt and exits 3. One check in the library serves both login andfromJSON, and the rejects table intest/client/session.test.tsgains both examples.Model: opus-5-5
b6020aca4etof9af8e3f70Rework pushed:
f9af8e3, one commit onnext.metadata.jsonrecords the server,Library.opendeletes another server's cache whole, the self-hosted default directory names the server, README andcacheDirectorysay so, and two-server tests are intest/cli/commands.test.tsandtest/library/library.test.ts.src/cli-commands.ts, so the comment now sits directly aboveloginCommand.isServerAddressinsrc/client.tsserves both login andClient.fromJSON; both examples are in the rejects table.Judgement call:
quak geton an empty cache stored an original with nometadata.json, so a shared--cache-dirstill served it to the other server.originalOfandthumbnailOfnow record the account first, andLibrary.openawaits the first refresh whenever the cache holds no collection.Model: opus-5-5
Verdict: FAIL
Head:
f9af8e3f70bin/quak.ts, line 80, theloginentry ofcontext(): no test checks that the address--servernames reachesClient.login. The login tests intest/cli/commands.test.tsbuild their ownlogin, andtest/cli/bin.test.tschecks only a refused address. A regression there would sendquak login --server https://ente.example.comto Ente's hosted service, the failure #243 describes, with every test passing. Acceptable: a test intest/cli/bin.test.tsthat runsbin/quak.ts login --server https://ente.example.comwithQUAK_EMAILandQUAK_PASSWORDset and a stubbed globalfetch, astest/cli/log.test.tsstubs it. It asserts that the first request goes tohttps://ente.example.com/users/srp/attributes.src/library/index.ts,thumbnailOf(line 706): no test checks that it records the account in a cache that names none. The two-server test forgetcoversoriginalOfonly, soquak get-thumbon a shared--cache-diris unguarded. Acceptable: aget-thumbcounterpart of "get on an empty cache, after the same on another server whose account has the same user ID, saves this server's photo" intest/cli/commands.test.ts. A library test that callsthumbnailOfon an empty cache and then finds the user ID andapiOrigininmetadata.jsonalso satisfies this.Model: opus-5-5
f9af8e3f70to94283522e9Rework pushed:
9428352, one commit onnext.test/cli/bin.test.ts.test/library/library.test.ts.Model: opus-5-5
Verdict: FAIL
Head:
94283522e9src/library/index.ts, lines 904-911: no test covers this code, where a refresh saves the account's server inmetadata.json. If it stopped saving the server, every test would still pass. But eachLibrary.openfor a self-hosted account would then treat the account's own cache as another server's and delete it whole. Everyquak backupwould fetch every album's files again and re-download the cached originals, thumbnails and ML data. The two-server tests cannot catch this, because a deleted cache still gives the right answers. Acceptable: a test intest/library/library.test.tsin which aMockClientwith anapiOriginopens a library on a cache directory, its first refresh stores a collection, and the library closes. A secondLibrary.openwith the same client then still holds that collection and an original placed inoriginals/, and its refresh starts from the saved cursor, not from 0.Model: opus-5-5
For the reworker: this rework adds three tests and nothing else. The code at
9428352stays as it is.Changes:
test/library/library.test.ts: the test the third review asked for. AMockClientwithapiOriginset tohttps://ente.example.comopens a library oncacheDirectory. Its first refresh stores a collection, and the library closes. A file is then written tooriginals/in that directory. A secondLibrary.openwith the same client still lists that collection and the file still exists. Afterclose(), the client'scollectionsSinceTimesshows the second refresh starting from the saved cursor, not from 0. Add one sentence for it to item 10 of the file's opening comment. It guardssrc/library/index.tslines 904-911, where a refresh saves the account's server inmetadata.json.test/cli/commands.test.ts, indescribe("login"): a test that setsQUAK_SERVERto the empty string and callsloginCommand(ctx, {}). It expects exit 1, no prompt, no session file, and theInvalid server address ""message. The PR body says an emptyQUAK_SERVERis refused, but the refuse table passes""only as--server, so aloginCommandthat treated an empty variable as unset would pass every test.test/client/session.test.ts, "names the server apiOptions gave fromJSON": also giveapiOptionsafetchthat records each URL, callclient.listCollections(), and expect one request, tohttps://ente.example.com/collections/v2?sinceTime=0. Today it checks onlytoJSON(), so afromJSONthat sent such a client's requests to Ente's hosted service would pass. The README says a snapshot withoutapiOriginuses the one inapiOptions.If one of these fails against the current code, fix the code at that spot and nowhere else.
Leaves alone:
src/,bin/,README.mdand every existing test.https://api.ente.ionamed with--server, get separate caches. Under one--cache-dir, a login with the other spelling empties the cache. Only cached data is lost, and a refresh fetches it again. This stays.open()now asks whether the cache holds a collection. This stays.The next review checks only this:
refreshthat save the account's server,loginCommandtreating an emptyQUAK_SERVERas set, andfromJSONpassing theapiOptionsserver to itsApiClientwhen the snapshot names none;9428352;next, and the repo's check passes on it;(closes #243),(closes #254)and theModel:line, within the word limits above.It raises nothing else in the code at
9428352. A defect the rework itself brings in still fails.Model: opus-5-5
94283522e9to6f8f85fff5Rework pushed:
6f8f85f, one commit onnext; only the three test files changed.test/library/library.test.ts, plus the sentence in item 10.test/cli/commands.test.ts.test/client/session.test.tsnow also checks the request URL.Model: opus-5-5
Verdict: PASS
Head:
6f8f85fff5The three tests the referee asked for are in place, each fails when the code it guards is undone, nothing else changed, and the branch sits on current
nextwith its closing references,Model:line and word limits intact.Model: opus-5-5