Library.open with a transparent background refresh (closes #42)
check / check (push) Successful in 24s
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
This commit was merged in pull request #60.
This commit is contained in:
@@ -33,6 +33,15 @@ export {
|
||||
requestEmailOTP,
|
||||
submitEmailOTP,
|
||||
} from "./auth/login.js";
|
||||
export {
|
||||
Library,
|
||||
DEFAULT_REFRESH_INTERVAL_SECONDS,
|
||||
type LibraryClient,
|
||||
type LibraryOptions,
|
||||
type LibraryStatus,
|
||||
type RefreshEvent,
|
||||
type RefreshProgressCallback,
|
||||
} from "./library/index.js";
|
||||
export { decryptCollection, decryptFile } from "./model/index.js";
|
||||
export { downloadFile, downloadThumbnail } from "./download/index.js";
|
||||
export type {
|
||||
|
||||
Reference in New Issue
Block a user