Files
minstrel/android
bvandeusen 0b1ccd59b1 feat(android): port cached_mutations (M8 4.2 slice 6)
Mirrors flutter_client/lib/cache/db.dart's CachedMutations — the
offline-write queue that MutationQueue.enqueue() inserts into when a
server-write fails with IOException and MutationReplayer.drain() pops
from when connectivity returns (Phase 12.2).

`kind` is a string registered in `MutationKind` (Phase 12.2) so the
replayer can map to the right handler. `payload` is JSON-serialized
args. Unknown kinds get dropped at drain time rather than wedging.

DAO surface tailored to the replayer:
  - observePendingCount: Flow<Int> for the offline-indicator badge
  - getAll: FIFO list for drain (id ASC = oldest first)
  - insert: returns the autoGenerate'd id
  - recordAttempt(id, instant): atomic increment + lastAttemptAt set
  - delete(id) / clear

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-22 15:02:02 -04:00
..