Offline queue & syncing
What happens on the phone when there is no network — what queues, when it uploads, and how to check the queue is moving.
Offline queue & syncing
Agents work in basements, lifts and villages. The app is built for that: everything you do without a network is queued on the phone and uploaded automatically when a connection returns. Nothing is lost if the phone stays offline for a while.
Who this is for
- Sales agents who noticed a "pending" indicator and want to know if their work is safe.
- Admins explaining sync behavior to the team.
Difficulty: Easy · Time: about 5 minutes · Prerequisites: none — this describes how the app behaves.
What queues, and what doesn't
| Queued and uploaded later | Needs connectivity now |
|---|---|
| Call events detected from the device call log | Logging in |
| Notes you add to a lead | Loading fresh lead lists / lead details |
| Stage changes (moving a lead through the pipeline) | Receiving push notifications |
| Follow-ups you create or complete | Uploading recording audio files |
Queued items are stored in an on-device database and uploaded in order by the app's sync worker. Home shows a pending badge while items are waiting; you can watch the count go down after a good connection.
How the sync works
- Automatic, every ~15 minutes — a periodic background worker checks the call log and pushes any queued changes.
- Automatic, on connection — queued work retries with exponential backoff; a flaky network just means later, not lost.
- On demand — force it any time:
- More → Device health → Background sync → SYNC NOW, or
- More → Settings → Sync → SYNC NOW.
- Failed items — if an item is rejected after retries, it stays visible in Settings → Sync, where RETRY FAILED re-sends it.
Step 1 — Check the queue state
- Open More → Device health and read the Background sync row:
- "Last sync: 5 Oct, 9:41 am" — a successful upload has happened.
- "Uploading now…" — the sync worker is running.
- "Waiting for a connection" — queued, waiting for network.
- "Some changes couldn't sync — we'll retry automatically." — backing off after a failure.
- "No successful sync yet — waiting for the first upload." — first sync hasn't completed.
- Tap SYNC NOW (Device health or Settings → Sync). The app also starts recording discovery at the same time.
- Watch Home: the pending badge clears as items upload.
Step 2 — Work offline with confidence
- Take calls, write notes, change stages — the app applies them immediately on screen.
- When the connection returns, the queue drains automatically; you do not need to keep the app open (the OS schedules the work).
- If you are offline for a long stretch, connect to Wi-Fi and open the app once, then use SYNC NOW to drain faster.
- For push-free periods, use Settings → Sync → SCAN CALL LOG NOW to pull recent calls immediately after reconnecting.
Expected result
- Nothing you entered offline is missing after a sync.
- Device health's Background sync row shows a recent "Last sync" time.
- Home has no stale pending badge.
Common mistakes
| Mistake | What happens | Fix |
|---|---|---|
| Logging out while offline with items queued | Queued items can't be uploaded after the token is cleared | Sync (SYNC NOW) before logging out, or stay logged in until online |
| Force-stopping the app from Android settings | Background sync stops until you reopen the app | Reopen the app; avoid force-stop on work phones |
| Assuming battery saver doesn't matter | Doze delays uploads by hours | Device health → Battery optimization → ALLOW UNRESTRICTED |
| Deleting the app with a pending queue | Queued items are lost with the app data | Sync first |
Troubleshooting
- Pending badge won't clear — check connectivity and the Background sync row; tap SYNC NOW. If it reports backing off, wait a few minutes or retry.
- One item keeps failing — open Settings → Sync and use RETRY FAILED. If it still fails, note the item and contact your admin with a Device health support report (see below).
- Calls made yesterday appear only now — normal after long offline periods; the call-log scan uploads up to 500 rows per pass, so large backlogs drain across a few syncs.
- Correct in the app but not in the CRM on the web — the device may be pointing at a different server (check the server line on the login screen) or the item is still queued.
Technical details
- On-device queue: Room database, drained by
com.leadhub.sales.data.sync.SyncWorker(unique workleadhub_sync) using WorkManager constraints, exponential backoff and per-item idempotency keys — a retried upload cannot create duplicates. - Call-log scan:
CallLogSyncWorker(unique workleadhub_calllog_scan), periodic every 15 minutes, max 500 rows per scan. - Server endpoints used:
POST /api/v1/mobile/call-events, lead stage/notes/follow-up endpoints under/api/v1/mobile/leads/.... - The redacted support report from Device health (see Device health) includes sync state if you need to escalate.
Related guides
Was this page helpful?
Thanks — noted. ✦