Commit Graph
3 Commits
Author SHA1 Message Date
clawbot 8be21c005f Test that a failed read during a store keeps the stored content type (closes #70)
A read that finds a variant in memory but cannot open its file removes
it from memory. When that happens after StoreVariant has added the
variant's content type, a read that opened the variant file before the
store wrote its .meta file finds memory empty and keeps
application/octet-stream there, so every later hit serves the image
with it. The test runs the store, the failed read and the read without
a .meta file in that order, then checks a later hit. It fails now.

Model: opus-5-5
2026-09-29 09:28:38 +00:00
clawbot 220fb3ee4e Test that a read during a store keeps the stored content type (closes #70)
A GetVariant that begins before StoreVariant finishes can find the
variant file but not yet its .meta file, and so reads
application/octet-stream. When it adds that to memory after the store
added the real type, the wrong type is served to every later hit. The
part of GetVariant that runs after its check of memory moves, unchanged,
into loadVariantWithMeta, so the test can run it after a store. The
test fails now.

Model: opus-5-5
2026-09-29 09:28:28 +00:00
clawbot 33c958ad1c Test that a cache hit takes the content type from memory (closes #70)
Tests for keeping each variant's content type in memory. A second hit
must still get the stored content type after the variant's .meta file
is deleted, whether the first came from storing the variant or from
reading it after a restart; this fails now. A variant removed by
EvictToLimit, or whose file was deleted from disk, must be a miss and
must not be served, and concurrent stores, reads and evictions run
under the race detector; these pass now and guard the change.

Model: opus-5-5
2026-09-29 09:28:16 +00:00