offline_cache_sync 0.1.0
offline_cache_sync: ^0.1.0 copied to clipboard
Offline-first data engine for Dart and Flutter. Keeps a durable outbox and a stale-while-revalidate cache consistent: pending edits survive restarts, refreshes never clobber them, eviction never loses [...]
0.1.0 #
First release: the pure-Dart core engine.
OfflineEngine,Repository<K, T>andResource<K, T>, with typedMutation<T>reducers (SetFields,Replace,Deletebuilt in).- Reads: fresh, stale-while-revalidate, expired fetch, stale-if-error and stale-if-offline windows; read coalescing; ETag/304 revalidation;
Cache-Control: max-agein advisory or strict mode; a fetch-epoch and version guard against out-of-order responses. - Writes: an atomic enqueue and a durable outbox; per-entity serial sends, parallel across entities;
dependsOn; exponential backoff with full jitter andRetry-After; dead-lettering; idempotency keys minted once and reused on every retry;Delivery.atLeastOnce/atMostOnce. - Crash recovery:
inFlightis marked write-ahead, a single-writer lease is held (LeaseMode.primary/secondary), ambiguous ops are recovered on startup, and ops of unknown kinds are dead-lettered. - Conflicts:
serverWins,clientWins, three-wayfieldMerge,parkandcustom. - Retention: LRU + retention TTL + priority + count/byte budgets. Entities with pending ops, pinned records and watched records are never evicted.
- Observability: typed
SyncEvents,SyncMetricsand anEventSinkport. - An
InMemoryLocalStoreplus theLocalStoreadapter SPI (adapter_api.dart).