kashi_sync 1.6.0
kashi_sync: ^1.6.0 copied to clipboard
Offline-first sync for Flutter apps on Drift, with a transactional outbox with batched push and retries, and a cursor-based pull that never overwrites unsent edits.
kashi_sync #
Flutter half of @softwareseva/sync, on Drift.
- Outbox: write locally and call
engine.enqueue(type, payload, entity:, entityId:)in the samedb.transaction. The engine pushes in batches, deletes applied or replayed ops, retries retryable failures with exponential backoff, and parks permanent failures inneedsAttention(). - Pull:
GET /sync/pull?since=<cursor>pages through the server's change log; each page applies in one transaction and advances the cursor. Rows with unsent local edits are skipped until the push lands, so offline edits are never overwritten. - Lifecycle:
start()after sign-in (periodic and on reconnect),clearAll()on sign-out.
The engine creates its own tables (kashi_outbox, kashi_sync_state); your Drift schema only holds your entities. See the flutter-drift-sync skill.