Luxar's zipped-store reader: a thin, lifecycle-safe wrapper over
@zarrita/storage's ZipFileStore.
The wrapper exists for one reason — WHEN the central directory is read.
Stock ZipFileStore reads it in its CONSTRUCTOR and memoizes the resulting
promise unconditionally:
Two consequences, both bad once the store sits behind a cache with a
dataset-switch lifecycle:
A failure is permanent. One transient blip while reading the ~141 kB
preamble rejects info forever; every later get throws the same stale
error, and the only recovery is a page reload.
Construction does I/O. Building a store — which the cache layer may do
while merely deciding policy — fires network requests before anyone has
asked for a key.
So: build lazily on first read, memoize only on success, and let a failed
attempt be retried by the next caller. Reads are driven by a per-store
AbortController that only dispose() trips, never a per-caller signal —
one cancelled chunk must not poison the directory every other chunk needs.
Luxar's zipped-store reader: a thin, lifecycle-safe wrapper over
@zarrita/storage'sZipFileStore.The wrapper exists for one reason — WHEN the central directory is read. Stock
ZipFileStorereads it in its CONSTRUCTOR and memoizes the resulting promise unconditionally:Two consequences, both bad once the store sits behind a cache with a dataset-switch lifecycle:
infoforever; every latergetthrows the same stale error, and the only recovery is a page reload.So: build lazily on first read, memoize only on success, and let a failed attempt be retried by the next caller. Reads are driven by a per-store
AbortControllerthat onlydispose()trips, never a per-caller signal — one cancelled chunk must not poison the directory every other chunk needs.