files --collection, get, get-thumb and helper fix-missing-thumbnails --file read their ID with Number(), so 0x10 fetched file 16, 1e3 file 1000 and an empty string file 0, while --file abc was dropped without a word and the command exited 0.
parseID in src/cli-commands.ts now does the check for all four: the ID must be decimal digits that make a safe integer, or the command prints one line, Invalid file ID: ARG (Invalid collection ID: ARG for files), and exits 1. The fixer checks every --file ID before it opens the library, so one bad ID fails the whole command before any request. The README's CLI surface section says so.
The new tests run each command on a real client over a fake Ente server holding an empty account, and check that a refused ID sends no request. A good ID therefore ends in "not found" with exit 1; those tests show that the ID passed the check and reached the server.
Judgement call: the check still comes after the session is loaded, as before, so with no saved session a bad ID still gets "Not logged in" and exit 3.
Judgement call: the refused IDs in the tests also include 9007199254740992, one past the largest safe integer.
The two older tests of a non-numeric ID, which asserted the old message, are folded into the new ones.
Model: opus-5-5
Implements https://git.eeqj.de/sneak/quak/issues/185.
`files --collection`, `get`, `get-thumb` and `helper fix-missing-thumbnails --file` read their ID with `Number()`, so `0x10` fetched file 16, `1e3` file 1000 and an empty string file 0, while `--file abc` was dropped without a word and the command exited 0.
`parseID` in `src/cli-commands.ts` now does the check for all four: the ID must be decimal digits that make a safe integer, or the command prints one line, `Invalid file ID: ARG` (`Invalid collection ID: ARG` for `files`), and exits 1. The fixer checks every `--file` ID before it opens the library, so one bad ID fails the whole command before any request. The README's CLI surface section says so.
The new tests run each command on a real client over a fake Ente server holding an empty account, and check that a refused ID sends no request. A good ID therefore ends in "not found" with exit 1; those tests show that the ID passed the check and reached the server.
- Judgement call: the check still comes after the session is loaded, as before, so with no saved session a bad ID still gets "Not logged in" and exit 3.
- Judgement call: the refused IDs in the tests also include 9007199254740992, one past the largest safe integer.
- The two older tests of a non-numeric ID, which asserted the old message, are folded into the new ones.
Model: opus-5-5
files --collection, get, get-thumb and helper fix-missing-thumbnails
--file must refuse 0x10, 1e3, 1.5, -1, an empty string, abc and an
integer past Number.MAX_SAFE_INTEGER with one line naming the argument,
and exit 1 before any request. A good ID goes on to the server. The
commands run on a real client over a fake Ente server holding an empty
account. The two older tests of a non-numeric ID are folded into these.
Model: opus-5-5
files --collection, get, get-thumb and helper fix-missing-thumbnails
--file read an ID with Number(), so 0x10 meant 16, 1e3 meant 1000 and
an empty string meant 0, and --file dropped an ID it could not read.
parseID in src/cli-commands.ts now takes an ID only when it is decimal
digits and a safe integer; anything else prints "Invalid file ID: ARG"
or "Invalid collection ID: ARG" and the command exits 1. The fixer
checks every --file ID before it opens the library, so one bad ID fails
the whole command before any request.
Model: opus-5-5
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.
Implements #185.
files --collection,get,get-thumbandhelper fix-missing-thumbnails --fileread their ID withNumber(), so0x10fetched file 16,1e3file 1000 and an empty string file 0, while--file abcwas dropped without a word and the command exited 0.parseIDinsrc/cli-commands.tsnow does the check for all four: the ID must be decimal digits that make a safe integer, or the command prints one line,Invalid file ID: ARG(Invalid collection ID: ARGforfiles), and exits 1. The fixer checks every--fileID before it opens the library, so one bad ID fails the whole command before any request. The README's CLI surface section says so.The new tests run each command on a real client over a fake Ente server holding an empty account, and check that a refused ID sends no request. A good ID therefore ends in "not found" with exit 1; those tests show that the ID passed the check and reached the server.
Model: opus-5-5
Review passed.
Model: opus-5-5