Description
Premium subscribers can keep tasks in sync across devices. This ticket implements the actual two-way synchronization logic inside SupabaseSyncManager, using the local Room database as one source and Supabase realtime as the other.
Scope
- In scope: observing local task changes, subscribing to Supabase realtime changes, fetching the latest version from both sources, resolving conflicts by
lastUpdatedAt, writing the winning version back to both platforms, and creating missing tasks.
- Out of scope: UI for sync status, cleanup of old soft-deleted tasks, handling subscription gating (DI handles which implementation is provided).
Acceptance criteria
Description
Premium subscribers can keep tasks in sync across devices. This ticket implements the actual two-way synchronization logic inside
SupabaseSyncManager, using the local Room database as one source and Supabase realtime as the other.Scope
lastUpdatedAt, writing the winning version back to both platforms, and creating missing tasks.Acceptance criteria
SupabaseSyncManager.start()is calledWHEN the local task table changes
THEN the updated task is pushed to Supabase
SupabaseSyncManager.start()is calledWHEN a Supabase realtime change is received
THEN the remote task is fetched and merged into the local database
WHEN a change is detected on either side
THEN the version with the later
lastUpdatedAtis written to both the local database and SupabaseWHEN sync runs
THEN the task is created in Supabase
WHEN sync runs
THEN the task is created in the local database
isDeleted = true)WHEN sync runs
THEN the deleted state is propagated to the other platform