offline_cache_sync 0.1.0 copy "offline_cache_sync: ^0.1.0" to clipboard
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> and Resource<K, T>, with typed Mutation<T> reducers (SetFields, Replace, Delete built in).
  • Reads: fresh, stale-while-revalidate, expired fetch, stale-if-error and stale-if-offline windows; read coalescing; ETag/304 revalidation; Cache-Control: max-age in 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 and Retry-After; dead-lettering; idempotency keys minted once and reused on every retry; Delivery.atLeastOnce / atMostOnce.
  • Crash recovery: inFlight is 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-way fieldMerge, park and custom.
  • Retention: LRU + retention TTL + priority + count/byte budgets. Entities with pending ops, pinned records and watched records are never evicted.
  • Observability: typed SyncEvents, SyncMetrics and an EventSink port.
  • An InMemoryLocalStore plus the LocalStore adapter SPI (adapter_api.dart).
1
likes
150
points
51
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

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 them, retries never duplicate them.

Repository (GitHub)
View/report issues

Topics

#offline-first #cache #sync #offline #repository

License

MIT (license)

More

Packages that depend on offline_cache_sync