@univerjs-pro/collaboration-client v0.5.4


Class: FetchingMissState

Defined in: packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:1209

When the client is trying to fetch missed changesets:

  1. local changesets would not be send to the server until the missed changesets are fetched
  2. remote changesets would not be applied util the missed changesets are fetched and applied

Extends

  • CollaborationState

Constructors

new FetchingMissState()

new FetchingMissState(
   unitID, 
   type, 
   awaitingChangeset, 
   pendingMutations, 
   _acknowledgedAwaitingChangeset, 
   _queuedRemoteChangesets, 
   handler, 
   _injector, 
   revisionService, 
   _logService, 
   commandService, 
   undoRedoService, 
   _transformService, 
   localCacheService?): FetchingMissState

Defined in: packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:1212

Parameters

ParameterTypeDescription
unitIDstring-
typeUniverType-
awaitingChangesetNullable<IChangeset>-
pendingMutationsIMutationInfo[]-
_acknowledgedAwaitingChangesetNullable<IChangeset>The awaiting changeset may have been acknowledged when missing is detected. We need to transform missing changeset against this acknowledged changeset, so other state should pass this acknowledged changeset to this parameter.
_queuedRemoteChangesetsIChangeset[]-
handlerICollaborationStateHandler-
_injectorInjector-
revisionServiceRevisionService-
_logServiceILogService-
commandServiceICommandService-
undoRedoServiceICollaborativeUndoRedoService-
_transformServiceITransformService-
localCacheService?ILocalCacheService-

Returns

FetchingMissState

Overrides

CollaborationState.constructor

Properties

PropertyModifierTypeDefault valueDescriptionOverridesInherited fromDefined in
_awaitingChangesetprotectedNullable<IChangeset>nullMutations that has been sent to the server but not yet acknowledged by the server.-CollaborationState._awaitingChangesetpackages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:92
_commandServicereadonlyICommandServiceundefined--CollaborationState._commandServicepackages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:103
_handlerreadonlyICollaborationStateHandlerundefinedState may change internally. Parent module should provide a callback to handle this event.-CollaborationState._handlerpackages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:102
_localCacheService?readonlyILocalCacheServiceundefined--CollaborationState._localCacheServicepackages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:106
_pendingMutationsprotectedIMutationInfo[][]Mutations that has not been sent to the server.-CollaborationState._pendingMutationspackages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:94
_revisionServicereadonlyRevisionServiceundefined--CollaborationState._revisionServicepackages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:105
_undoRedoServicereadonlyICollaborativeUndoRedoServiceundefined--CollaborationState._undoRedoServicepackages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:104
statusreadonlyFETCH_MISSCollaborationStatus.FETCH_MISS-CollaborationState.status-packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:1210
typereadonlyUniverTypeundefined--CollaborationState.typepackages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:98
unitIDreadonlystringundefined--CollaborationState.unitIDpackages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:97

Methods

_checkMissing()

protected _checkMissing(changeset): boolean

Defined in: packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:148

Check if there are some changesets missing. If true, the state should abort this changeset and request for missing changesets. Missing changesets will later be passed to onRemoteChangeset method.

Parameters

ParameterTypeDescription
changeset| IChangeset | IAcknowledgedChangesetThe changeset sent from the remote collaboration server.

Returns

boolean

There is some changeset missing.

Inherited from

CollaborationState._checkMissing

_executeRemoteChangeset()

protected _executeRemoteChangeset(changeset): void

Defined in: packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:224

Parameters

ParameterType
changesetIChangeset

Returns

void

Inherited from

CollaborationState._executeRemoteChangeset

_getCurrentRevision()

protected _getCurrentRevision(): number

Defined in: packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:216

Returns

number

Inherited from

CollaborationState._getCurrentRevision

_incrementRevisionNumber()

protected _incrementRevisionNumber(): void

Defined in: packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:220

Returns

void

Inherited from

CollaborationState._incrementRevisionNumber

_syncEditingCollabCursor()

protected _syncEditingCollabCursor(changeset): void

Defined in: packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:190

Parameters

ParameterType
changesetIChangeset

Returns

void

Inherited from

CollaborationState._syncEditingCollabCursor

_transformIMECache()

protected _transformIMECache(changeset): undefined | void

Defined in: packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:173

Parameters

ParameterType
changesetIChangeset

Returns

undefined | void

Inherited from

CollaborationState._transformIMECache

_transformRemoteChangesetByIMECache()

protected _transformRemoteChangesetByIMECache(changeset): IChangeset

Defined in: packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:181

Parameters

ParameterType
changesetIChangeset

Returns

IChangeset

Inherited from

CollaborationState._transformRemoteChangesetByIMECache

_transformRemoteChangesetByStateCache()

protected _transformRemoteChangesetByStateCache(changeset): IChangeset

Defined in: packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:185

Parameters

ParameterType
changesetIChangeset

Returns

IChangeset

Inherited from

CollaborationState._transformRemoteChangesetByStateCache

_transformSelections()

protected _transformSelections(changeset): void

Defined in: packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:169

Transform selections by calling the selection manager service.

Parameters

ParameterType
changesetIChangeset

Returns

void

Inherited from

CollaborationState._transformSelections

_transformStateCache()

protected _transformStateCache(changeset): undefined | void

Defined in: packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:177

Parameters

ParameterType
changesetIChangeset

Returns

undefined | void

Inherited from

CollaborationState._transformStateCache

_transformUndoredo()

protected _transformUndoredo(changeset): void

Defined in: packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:164

Transform undo redo mutations in the undo redo stack.

Parameters

ParameterType
changesetIChangeset

Returns

void

Inherited from

CollaborationState._transformUndoredo

_updateLocalCache()

_updateLocalCache(): void

Defined in: packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:207

Internal

Returns

void

Inherited from

CollaborationState._updateLocalCache

appendMutation()

appendMutation(mutation): CollaborationState

Defined in: packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:1372

Append a location mutation to collaboration queue.

Parameters

ParameterTypeDescription
mutationIMutationInfoa mutation that happened locally and should be broadcasted to other peers

Returns

CollaborationState

Overrides

CollaborationState.appendMutation

onMissedChangesetFetched()

onMissedChangesetFetched(changesets): CollaborationState

Defined in: packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:1247

Parameters

ParameterType
changesetsIChangeset[]

Returns

CollaborationState


onRemoteAck()

onRemoteAck(_changeset): CollaborationState

Defined in: packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:1383

Received an acknowledgement from the server.

Parameters

ParameterType
_changesetIAcknowledgedChangeset

Returns

CollaborationState

Overrides

CollaborationState.onRemoteAck

onRemoteChangeset()

onRemoteChangeset(changeset): CollaborationState

Defined in: packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:1377

Received a changeset from the server.

Parameters

ParameterType
changesetIChangeset

Returns

CollaborationState

Overrides

CollaborationState.onRemoteChangeset

onRemoteRej()

onRemoteRej(config?): CollaborationState

Defined in: packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:1392

Received a rejection from the server, meaning that conflict could be resolved by the algorithm.

Parameters

ParameterType
config?{ isPermissionRej: boolean; }
config.isPermissionRej?boolean

Returns

CollaborationState

Overrides

CollaborationState.onRemoteRej

onRemoteRetry()

onRemoteRetry(): CollaborationState

Defined in: packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:1396

Received a retry message from the server, meaning that some unexpected error occurred in server.

Returns

CollaborationState

Overrides

CollaborationState.onRemoteRetry

resend()

resend(): void

Defined in: packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:1368

Returns

void

Overrides

CollaborationState.resend

toggleOffline()

toggleOffline(): CollaborationState

Defined in: packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:1400

Returns

CollaborationState

Overrides

CollaborationState.toggleOffline

toggleOnline()

toggleOnline(): CollaborationState

Defined in: packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:1413

Returns

CollaborationState

Overrides

CollaborationState.toggleOnline