Skip to content

Story 4: Work Offline and Sync

Available Now

This feature is fully implemented in the current version.

As a field worker I want to add elements and inspections without internet So that I can work anywhere on the property

User Journey

Wireframes

State 1: Online (normal)

┌─────────────────────────┐
│  Waterworks        [+]  │
├─────────────────────────┤
│                         │
│     (map content)       │
│                         │
├─────────────────────────┤
│  ● Online               │
└─────────────────────────┘

State 2: Offline with pending changes

┌─────────────────────────┐
│  Waterworks        [+]  │
├───────────────┬─────────┤
│               │ Offline │
│  (map)        │   🟠    │
│               │         │
├───────────────┴─────────┤
│  ⏳ 3 changes pending   │
└─────────────────────────┘

State 3: Syncing

┌─────────────────────────┐
│  Waterworks        [+]  │
├─────────────────────────┤
│                         │
│     (map content)       │
│                         │
├─────────────────────────┤
│  ↻ Syncing 3 changes... │
└─────────────────────────┘

State 4: Sync complete (toast)

┌─────────────────────────┐
│  Waterworks        [+]  │
├─────────────────────────┤
│                         │
│     (map content)       │
│                         │
├─────────────────────────┤
│  ✓ All changes synced   │
│  ● Online               │
└─────────────────────────┘

Steps

  1. Lose signal - App detects offline state
  2. Continue working - Add elements, record inspections
  3. See pending count - Badge shows queued changes
  4. Regain signal - App auto-detects connectivity
  5. Auto-sync - Changes push to cloud
  6. Confirmation - Toast shows sync complete

Key Behaviors

Offline Capabilities

All features work without internet:

  • ✅ Capture photos
  • ✅ AI classification (on-device)
  • ✅ GPS location capture
  • ✅ Create elements
  • ✅ View existing data
  • ✅ Search and filter

Sync Behavior

ActionBehavior
Lose connectionAuto-detects, shows offline indicator
Create elementSaves locally, increments pending count
Regain connectionAuto-starts sync
Sync in progressShows progress indicator
Sync completeToast notification, counter clears

Conflict Resolution

When multiple devices edit the same element offline:

  • Last-write-wins with timestamps
  • Photos are never lost (all kept)
  • User notified of conflicts if detected

Implementation Status

Partially Implemented - Local persistence with SwiftData works fully offline (M0-M4). Cloud sync to backend is in progress (M5). Currently, all data stays on-device. Multi-device sync will be available once M5 is complete.

Your Data Is Safe

Don't worry about losing work. When you're offline:

  • Every element you create is saved immediately to your device
  • Every photo you capture is stored locally
  • Every edit you make is preserved

When connectivity returns, the app automatically syncs everything. You don't need to do anything—just keep working.

What if sync fails? If there's an error during sync, the app will retry automatically. Your pending changes stay queued until they're successfully uploaded. You'll see the count of pending changes in the Settings tab.

Point. Snap. Confirm.