offline_courier 0.2.1
offline_courier: ^0.2.1 copied to clipboard
Offline-first HTTP outbox for Flutter: persists requests in native SQLite and replays them with backoff when the network returns, even after the app is killed. Zero dependencies.
0.2.1 #
- Shorter package description for pub.dev and search engines.
- Code formatted with
dart format.
0.2.0 #
CourierService(Android): a foreground service with its own Flutter engine that runs your callback everyintervalwithOfflineCourier.instanceready. It keeps working with the screen off, after Back, after a swipe from Recents (it is restarted if the system kills the process) and, withresumeAfterReboot, after a reboot or an app update.CourierNotification: title, text, channel, icon, stop action and tap behaviour, set from code before starting;updateNotificationchanges it at runtime (also from the callback).start,pause,resume,stop,state,isRunning,watchStateandrequestNotificationPermission. Paused services release their wake lock.startvalidates the manifest declaration and permissions and explains what is missing.OfflineCourier.configBuilderexposes the builder passed toinitialize.
0.1.0 #
- Initial release, with zero dependencies beyond the Flutter SDK.
OfflineCourierfacade:send,post/put/patch/delete,enqueue,syncNow,events,watchPendingCount, dead-letter management.SyncEnginewith exponential backoff, full/equal jitter,Retry-Aftersupport, TTL (maxAge), single-flight drains and lease-based claims safe across isolates.- Native SQLite store (Android
android.database.sqlite, iOSlibsqlite3) shared by every engine, with a pluggable Dart-sidePayloadCipher. - Native connectivity (
ConnectivityManagervalidated networks /NWPathMonitor). - Native background sync (
JobScheduler/BGTaskScheduler) running a headless engine that rebuilds the app's top-level config builder. - iOS background sync (BGTaskScheduler) is implemented but not yet verified on a physical iPhone; foreground behaviour is verified on the simulator.
IoRequestExecutorondart:io;Idempotency-Keyheader on every attempt; timed-out requests are aborted.dedupeKeylast-write-wins, also against an older version that is in flight (it is superseded and never re-sent after the newer one).OrderingMode.strictPerTagkeeps FIFO even with concurrentsendcalls.- The app isolate keeps draining (retry timer included) while the app is in the background but alive, e.g. under a foreground service; the OS job is armed as a backup.
- When a request to a server succeeds, tasks waiting for a retry on that same server are sent right away instead of sleeping through their backoff (429 responses keep their wait).
- Tasks created in the same millisecond keep their FIFO order.
- Background runs free the drain lock and leases of an engine the OS stopped, re-arm themselves after skipping a held lock, and step aside while the app is visible (the periodic job uses a flex window).