syncache 0.1.2
syncache: ^0.1.2 copied to clipboard
An offline-first cache and sync engine for Dart with optimistic mutations, reactive streams, and pluggable storage.
0.1.2 #
Fixed #
mutateListItemwithupdateWherenow sends the item matching the predicate (previously it sent the first item of the list and never evaluated the predicate)mutateListItemwithremoveWherenow callssendonce per removed item, deduplicated byidSelector(previously the server call was silently skipped)- Plain
writenow preserves existing tags on allTaggableStoreimplementations — behavior was previously inconsistent betweenMemoryStore/SharedMemoryStore(preserve) andHiveStore(clear). The contract is now documented onTaggableStore: plainwritepreserves tags,writeWithTagsreplaces them CacheMissForConditionalExceptionis now exported from the public API and extendsCacheMissException, so conditional cache misses can be caught with a singleon CacheMissExceptionclauseScopedSyncache.prefetchnow passes throughPrefetchRequest.retry- Documentation: fixed the
Network,RetryConfig, andSyncacheObserverexamples; policy table now includescacheAndRefresh
Added #
ScopedSyncache.setandScopedSyncache.watchWithDependenciesScopedSyncache.prefetchOneaccepts aretryparameter- Shared
TaggableStoreconformance suite covering tag lifecycle semantics - Tests for
getConditional(conditional headers, 304 handling, cache-miss behavior)
0.1.1 #
- Add
Policy.cacheAndRefresh- returns cached data immediately and always refreshes in background (unlikestaleWhileRefreshwhich only refreshes when expired)
0.1.0 #
- Initial release
- Core caching with five policies: offlineFirst, cacheOnly, networkOnly, refresh, staleWhileRefresh
- Reactive streams via
watch()andwatchWithMeta() - Optimistic mutations with automatic background sync
- Tag-based cache invalidation
- Pattern-based cache invalidation (glob support)
- Request deduplication for concurrent fetches
- Retry with exponential backoff
- Cancellation token support
- Scoped caches with key prefixing
- Parallel and dependency-graph prefetching
- Observer pattern for logging and analytics
- MemoryStore and SharedMemoryStore implementations