Refuse an unparseable exp with 400; log swallowed cache errors (closes #72) #141

Merged
clawbot merged 4 commits from issue-72-exp-and-swallowed-errors into next 2026-09-28 19:59:39 +02:00
4 Commits
Author SHA1 Message Date
sneak 6735b42e55 Name exp in the errInvalidFormField comment (closes #72)
check / check (push) Successful in 2m41s
parseExpires wraps errInvalidFormField for exp, so its comment names exp
alongside q.

Model: opus-5-5
2026-09-28 17:43:34 +00:00
sneak 004ccf3fc8 Test the warn lines of failed cache writes and stats queries (closes #72)
A directory where a variant .meta file goes, and dropped tables in the
test database, make the variant .meta write, the two Stats count queries
and the stats counter updates fail. Each test hands the cache or
NewVariantStorage a logger writing to a buffer, checks the warn line, and
checks the store and Stats calls still succeed.

Model: opus-5-5
2026-09-28 17:43:34 +00:00
sneak 0ec806fb67 Refuse an unparseable exp with 400; log swallowed cache errors (closes #72)
check / check (push) Successful in 3m6s
An exp that was not a whole number, or empty, was ignored, so a URL for
a host that needs a signature got 401 as if it had no exp. It is now a
400 naming exp and the value; only an exp missing from the URL is
unchanged.

A failed variant .meta write, source metadata JSON write, Stats count
query, stats counter update, negative cache write or expired negative
cache delete was discarded without a trace. Each is now logged at warn
with the path or key and the error, and stays non-fatal. VariantStorage
takes the cache's logger for this. The metadata JSON write moved out of
StoreSource into writeMetadataSidecar to keep StoreSource within the
function length limit.

Model: opus-5-5
2026-09-28 17:24:13 +00:00
sneak dd2d256bc2 Test that an unparseable exp on /v1/image/ is refused with 400 (closes #72)
check / check (push) Failing after 1m57s
An exp that is not a whole number, or an empty exp=, is ignored today,
so a URL for a host that needs a signature gets 401 as if it had no exp.
This test asks for a 400 naming exp and the value instead; it fails
until the route refuses it. A URL without exp still gets 401.

Model: opus-5-5
2026-09-28 17:16:53 +00:00