to select ↑↓ to navigate
mForm Docs

mForm Docs

Open in ChatGPT
Ask ChatGPT about this page
Open in Claude
Ask Claude about this page

Offline-first sync

Each doctype gets its own SQLite table with typed columns, plus an outbox queue for pending writes.

Entries save on the device immediately and stay there until the server confirms them. Sync retries automatically on reconnect, and sync status is visible to the user.

offline_enabled defaults to off. An offline-first deployment must set it to true on the server before devices upgrade.

Driving sync from code

SyncController (sdk.syncController) gives you syncNow, pause, resume, retry, retryAll, resolveConflict, and a delete-cascade preview, plus a state$ stream to observe it. Use this if the ready-made screens don't cover your UI.

The ready-made sync UI widgets, SyncStatusBar, SyncProgressScreen, SyncErrorsScreen, and DocumentListFilterChip, are covered in Ready-made screens.

Pulls only fetch what changed

A (modified, name) watermark is kept per doctype. The first pull for a doctype gets everything; every pull after that is a delta against the watermark. A sync that gets interrupted resumes from the cursor instead of starting over.

Writes drain in dependency order

The outbox drains in tiers, not in the order things were typed: a record that points at another unsent record waits for that record to go up first. This is what lets you create a parent and a child offline, in either order, and have them push correctly.

Going deeper

  • Offline-first deep dive: the full data layer, covering pull lifecycle, write path, UnifiedResolver, SyncController, attachments.
  • Offline mode toggle: the server-driven flag in detail, including what stays local in online mode and how the online↔offline transition works on a device.
Last updated 1 month ago
Was this helpful?
Thanks!