When sync runs
Two triggers:
Every 30 seconds on an internal timer — quietly flushes anything in the queue.
On connectivity change — if the phone goes from offline to online (e.g. WiFi reconnects), sync runs immediately.
Note — Pull-to-refresh in list views reloads from the server, but doesn't separately force-sync the outbound queue. The 30-second timer takes care of that automatically.
Retries
If a sync attempt fails (server error, no signal, conflicting state), the item stays in the queue and the app retries on the next tick. There's no maximum retry count today — items keep retrying until they succeed or you uninstall the app.
Heads up — If something has been failing to sync for a long time (you'll spot it via Settings → Pending sync count), screenshot the count and contact [email protected] before reinstalling — uninstalling the app drops the local queue.
Conflicts
Carerealm leans on the data model to avoid conflicts where it can. Diary entries are amend-only on the server, so two devices writing different entries for the same day produce two entries — neither overwrites the other. Where the same record is edited from two devices, the server uses last-write-wins.