An ID on the command line is decimal digits only (closes #185) #189

Merged
clawbot merged 2 commits from issue-185-decimal-ids into next 2026-10-14 03:06:35 +02:00
2 Commits
Author SHA1 Message Date
sneak 6a6b3ef478 An ID on the command line is decimal digits only (closes #185)
check / check (push) Waiting to run
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
2026-10-14 00:24:54 +00:00
sneak ccb9b3d11d Tests: an ID on the command line is decimal digits only
check / check (push) Waiting to run
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
2026-10-14 00:17:35 +00:00