IncrementalSyncManager

internal class IncrementalSyncManager(slowSyncRepository: SlowSyncRepository, incrementalSyncWorker: IncrementalSyncWorker, incrementalSyncRepository: IncrementalSyncRepository, incrementalSyncRecoveryHandler: IncrementalSyncRecoveryHandler, networkStateObserver: <Error class: unknown class>, logger: <Error class: unknown class> = kaliumLogger, kaliumDispatcher: <Error class: unknown class> = KaliumDispatcherImpl, exponentialDurationHelper: ExponentialDurationHelper = ExponentialDurationHelperImpl( MIN_RETRY_DELAY, MAX_RETRY_DELAY ))

Starts and Stops Incremental Sync once SlowSync is performed.

Incremental Sync consists of receiving events, such as:

  • Messages

  • User Updates (like name, email, avatar)

  • Conversation Updates (name, add/remove members)

  • Team Updates (new member, name change)

  • Feature Flags Updates And many more.

Events come from an EventSource. Because EventSource.LIVE requires a constant Websocket connection, connectivity changes may drop the IncrementalSyncStatus down to IncrementalSyncStatus.Failed.

If an Event is lost, e.g. when this client becomes offline for too long, SlowSync will be invalidated and SlowSyncManager should perform a fresh SlowSync.

This Manager retries automatically in case of failures, but still doesn't actively monitor connectivity changes in general, like when a mobile phone changes from Wi-Fi to Mobile Data, etc.

See also

Constructors

Link copied to clipboard
constructor(slowSyncRepository: SlowSyncRepository, incrementalSyncWorker: IncrementalSyncWorker, incrementalSyncRepository: IncrementalSyncRepository, incrementalSyncRecoveryHandler: IncrementalSyncRecoveryHandler, networkStateObserver: <Error class: unknown class>, logger: <Error class: unknown class> = kaliumLogger, kaliumDispatcher: <Error class: unknown class> = KaliumDispatcherImpl, exponentialDurationHelper: ExponentialDurationHelper = ExponentialDurationHelperImpl( MIN_RETRY_DELAY, MAX_RETRY_DELAY ))