[][src]Module sync15::state

Structs

EngineChangesNeeded
EngineStateInput
EngineStateOutput
GlobalState

Holds global Sync state, including server upload limits, the last-fetched collection modified times, meta/global record, and encrypted copies of the crypto/keys resourse (which we hold as encrypted both to avoid keeping them in memory longer than necessary, and guard against the wrong (ie, a different user's) root key being passed in.

RemoteEngineState
SetupStateMachine

Enums

PersistedGlobalState

State that we require the app to persist to storage for us. It's a little unfortunate we need this, because it's only tracking "declined engines", and even then, only needed in practice when there's no meta/global so we need to create one. It's extra unfortunate because we want to move away from "globally declined" engines anyway, moving towards allowing engines to be enabled or disabled per client rather than globally.

SetupState

States in the remote setup process. TODO(lina): Add link once #56 is merged.

Constants

DEFAULT_DECLINED
DEFAULT_ENGINES

Maps names to storage versions for engines to include in a fresh meta/global record. We include engines that we don't implement because they'll be disabled on other clients if we omit them (bug 1479929).

STORAGE_VERSION

Functions

compute_engine_states
fixup_meta_global
is_same_timestamp

Whether we should skip fetching an item. Used when we already have timestamps and want to check if we should reuse our existing state. The state's fairly cheap to recreate and very bad to use if it is wrong, so we insist on the exact timestamp matching and not a simple "later than" check.

new_global

Creates a fresh meta/global record, using the default engine selections, and declined engines from our PersistedGlobalState.