Sync cached files and refuse ones left empty or partial (closes #252)

Source and variant files are synced to disk before the rename into
place, and their directory after. Lookup and LookupSource compare the
file's size with the size its row records: a file that is empty or of
another size is removed with its rows and a warning naming it, and the
request converts the image or fetches the source again. A variant whose
row cannot be read is judged by its file alone. Storing a source over a
file of another size replaces it. A source that fails to decode is not
removed for that alone.

#252

Model: opus-5-5
This commit is contained in:
2026-10-15 04:36:05 +00:00
parent a1fc42b80e
commit 36a4ce22c3
5 changed files with 168 additions and 21 deletions
+9
View File
@@ -38,6 +38,15 @@ P2: security: per-origin rate limiting
commented entry under `example.com`. Getting Started and "Running under upaas"
in `README.md` say that every image on an allowlisted host is served without a
signature, so an allowlisted host must be one the operator controls.
- 2026-10-15 a cached file left empty or partial is no longer served, or fetched
again on every request (closes #252). Source and transformed image files are
synced to disk before they are renamed into place, and their directory after.
A request that finds a cached source or transformed image whose file is empty,
or not the size the database records for it, removes it with a log line naming
it, and fetches the source or converts the image again. Storing a source over
a file of another size replaces that file. A source that fails to decode is
not removed for that alone: a damaged upstream image would then be fetched on
every request.
- 2026-10-13 `fit=outside` no longer makes an output above 8192 on a side
(closes #257): it scales the image to cover the requested size, and the side
scaled past that size was held to no maximum, so `1x8192?fit=outside` of a