Problem
After a full sync completes, five large tables — ratings, courses_progress, submissions, login_activities, and team_activities — are synced via a background coroutine which processes each sequentially by paginated batches (with copyToRealmOrUpdate).
There are two key failure modes:
-
No checkpoint persistence
- Pagination skip offset (tracking sync progress) is only held in memory.
- If the app is killed, force-stopped, or OOMs mid-way, or if network is lost, the next sync starts from
skip=0 for the affected table.
- On large installs, this can require re-downloading tens of thousands of rows on every interruption.
-
No per-session progress on network loss
- If network goes down during background sync, the current offset is discarded.
- On restoration, the user must trigger a new full sync from scratch.
- Worse, in some cases (e.g. HTTP 503 from the server), code paths delete any partial progress, so even transient errors erase checkpoints.
Problem
After a full sync completes, five large tables —
ratings,courses_progress,submissions,login_activities, andteam_activities— are synced via a background coroutine which processes each sequentially by paginated batches (withcopyToRealmOrUpdate).There are two key failure modes:
No checkpoint persistence
skip=0for the affected table.No per-session progress on network loss