SmartWalkingEvent

sealed class SmartWalkingEvent

Lifecycle events emitted by SmartWalking. Subscribe via com.advantahealth.api.smartwalking.SmartWalking.subscribeToEvents or observe com.advantahealth.api.smartwalking.SmartWalking.syncEvents.

A single sync cycle emits in this order:

SyncStarted
├─ SyncFailed (pre-submission failure)
└─ SyncSubmitted → (SyncProcessed | SyncProcessingTimedOut |
SyncProcessingDeferred | SyncFailed) (after server accepts)

Refresh activity totals on SyncProcessed; SyncSubmitted only means the API accepted the data, not that it's queryable yet. AutoSyncEnabled / AutoSyncDisabled fire independently when auto-sync state changes.

Inheritors

Types

Link copied to clipboard

Auto-sync was turned on (either by com.advantahealth.api.smartwalking.SmartWalking.enableAutoSync or auto-restore on init).

Link copied to clipboard
data class SyncFailed(val message: String, val cause: Throwable? = null) : SmartWalkingEvent

Terminal: submission or backend processing failed. cause is non-null when an exception was thrown.

Link copied to clipboard
data class SyncProcessed(val jobId: String) : SmartWalkingEvent

Terminal: backend job reached status completed. Data has been promoted to the Main DB and is queryable via the Mobile API. Refresh activity totals here.

Link copied to clipboard

Terminal: the SmartWalking API accepted the submission but did not issue a jobId (see ProcessingDeferralReason), so the SDK cannot track end-to-end processing. The data is acknowledged and will be picked up by a backend-side scheduled promotion task or the next com.advantahealth.api.smartwalking.SmartWalking.syncSteps call. Consumers may surface a "processing pending" hint and/or refresh on their own cadence.

Link copied to clipboard

Terminal: backend accepted the job but the SDK exhausted its polling budget before confirming completion. The data will still land on a later Windows Service cycle; consumers may refresh anyway, accepting that the latest submission might not be reflected yet.

Link copied to clipboard

A sync cycle has started. Always followed by SyncSubmitted or SyncFailed.

Link copied to clipboard
data class SyncSubmitted(val result: AFResult, val jobId: String? = null) : SmartWalkingEvent

The SmartWalking API accepted the submission. The data is in the SmartWalking DB but has not yet been promoted to the Main DB, so it is not queryable via the Mobile API yet — do not refresh activity totals on this event.