Commit Graph
2 Commits
Author SHA1 Message Date
sneak 307f1713c8 Fix two intermittently failing library tests (closes #90)
check / check (push) Successful in 28s
Library.close() now returns a promise that resolves once an in-flight
refresh, including its cache write, has finished. A refresh changes RAM
before it writes the cache file, so the interval test could see the new
state, close, and remove the directory while the write was still running.
The library tests now await close().

The precache test waited for its stub source to be called, but the cache
records a file only after checking it on disk, so status() could lag. It
now waits for both fills to report "done".

Model: opus-5-5
2026-09-23 01:26:12 +00:00
clawbot 7570055a5b Library.open with a transparent background refresh (closes #42)
check / check (push) Successful in 24s
Library.open loads metadata.json and serves reads from RAM: an empty cache awaits the first refresh, an existing cache returns at once and refreshes in the background so an unreachable server never stalls open(). A background timer refreshes every refreshIntervalSeconds (default 3), diffing only changed albums via the resumable cursor+tombstone enumerators and rewriting metadata.json only when something changed. A refresh failure is invisible to reads and surfaced via status()/onProgress; a failed save keeps status().lastError set and retries until one lands, so a stale disk is never masked. No sync()/refresh()/serverReachable surface; status() and close() included.

Model: opus-4-8
2026-09-22 14:52:02 +02:00