Skip to content
v1.10.9-dev — Session Lifecycle Reliability

Fix 6 critical gaps in device session management:

- R1: Aggressive orphan session closure — force-end sessions on BLE
  disconnect, app detach, and device switch (24h orphan window → immediate)
- R2: Persistent snapshot buffer — mini-flush to SQLite every 5s instead
  of 30s memory-only buffer (max data loss: 30min → 5s)
- R4: Explicit session end on device switch — prevents orphaned sessions
  when user switches between HHO devices

- R3: Session resume on BLE reconnect — detects if cell is still in active
  state after reconnection and resumes or starts a new session
- R7: Auto-initialize offline sync queue — SyncService starts on app boot,
  processes pending REST sync operations on startup and network restore
- R8: Atomic debounce cancel — fixes race condition where BLE reconnect and
  disconnect timer could fire simultaneously, causing unnecessary WS teardown

- snapshot_collector.dart: forceEndSession(), checkAndResumeSession(),
  mini-flush timer, hasActiveSession getter
- modbus_providers.dart: session end on BLE disconnect, debounce token,
  session continuity check after reconnect
- device_providers.dart: forceEndSession before device switch cleanup
- app.dart: session end on app detach, sync service auto-init
- sync_queue_service.dart: payload-based queue methods for offline sync
- sync_providers.dart: auto-initialize SyncService