@univerjs-pro/collaboration-client v0.5.4
Class: PendingState
Defined in: packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:386
Some local changes are waiting to be sent to the server. But no changesets are waiting for acknowledgement.
You should call schedule task after you create a PendingState
.
Extends
CollaborationState
Constructors
new PendingState()
new PendingState(
unitID,
type,
pendingMutations,
handler,
_injector,
_revisionService,
_memberService,
_logService,
commandService,
_configService,
_transformService,
_univerInstanceService,
_undoRedoService,
_localCacheService?): PendingState
Defined in: packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:393
Parameters
Parameter | Type |
---|---|
unitID | string |
type | UniverType |
pendingMutations | IMutationInfo [] |
handler | ICollaborationStateHandler |
_injector | Injector |
_revisionService | RevisionService |
_memberService | MemberService |
_logService | ILogService |
commandService | ICommandService |
_configService | IConfigService |
_transformService | ITransformService |
_univerInstanceService | IUniverInstanceService |
_undoRedoService | ICollaborativeUndoRedoService |
_localCacheService ? | ILocalCacheService |
Returns
Overrides
CollaborationState.constructor
Properties
Property | Modifier | Type | Default value | Description | Overrides | Inherited from | Defined in |
---|---|---|---|---|---|---|---|
_awaitingChangeset | protected | Nullable <IChangeset > | null | Mutations that has been sent to the server but not yet acknowledged by the server. | - | CollaborationState._awaitingChangeset | packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:92 |
_commandService | readonly | ICommandService | undefined | - | - | CollaborationState._commandService | packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:103 |
_handler | readonly | ICollaborationStateHandler | undefined | State may change internally. Parent module should provide a callback to handle this event. | - | CollaborationState._handler | packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:102 |
_localCacheService? | readonly | ILocalCacheService | undefined | - | - | CollaborationState._localCacheService | packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:106 |
_pendingMutations | protected | IMutationInfo [] | [] | Mutations that has not been sent to the server. | - | CollaborationState._pendingMutations | packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:94 |
_revisionService | readonly | RevisionService | undefined | - | - | CollaborationState._revisionService | packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:105 |
_undoRedoService | readonly | ICollaborativeUndoRedoService | undefined | - | - | CollaborationState._undoRedoService | packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:104 |
status | readonly | PENDING | CollaborationStatus.PENDING | - | CollaborationState.status | - | packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:387 |
type | readonly | UniverType | undefined | - | - | CollaborationState.type | packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:98 |
unitID | readonly | string | undefined | - | - | CollaborationState.unitID | packages/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
Parameter | Type | Description |
---|---|---|
changeset | | IChangeset | IAcknowledgedChangeset | The 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
Parameter | Type |
---|---|
changeset | IChangeset |
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
_schedule()
_schedule(t?): void
Defined in: packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:521
Internal
Schedule a task to send changeset to the server.
Parameters
Parameter | Type |
---|---|
t ? | number |
Returns
void
_syncEditingCollabCursor()
protected _syncEditingCollabCursor(changeset): void
Defined in: packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:190
Parameters
Parameter | Type |
---|---|
changeset | IChangeset |
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
Parameter | Type |
---|---|
changeset | IChangeset |
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
Parameter | Type |
---|---|
changeset | IChangeset |
Returns
Inherited from
CollaborationState._transformRemoteChangesetByIMECache
_transformRemoteChangesetByStateCache()
protected _transformRemoteChangesetByStateCache(changeset): IChangeset
Defined in: packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:185
Parameters
Parameter | Type |
---|---|
changeset | IChangeset |
Returns
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
Parameter | Type |
---|---|
changeset | IChangeset |
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
Parameter | Type |
---|---|
changeset | IChangeset |
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
Parameter | Type |
---|---|
changeset | IChangeset |
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:422
Append a location mutation to collaboration queue.
Parameters
Parameter | Type | Description |
---|---|---|
mutation | IMutationInfo | a mutation that happened locally and should be broadcasted to other peers |
Returns
CollaborationState
Overrides
CollaborationState.appendMutation
onRemoteAck()
onRemoteAck(): CollaborationState
Defined in: packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:487
Received an acknowledgement from the server.
Returns
CollaborationState
Overrides
CollaborationState.onRemoteAck
onRemoteChangeset()
onRemoteChangeset(changeset): CollaborationState
Defined in: packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:430
Received a changeset from the server.
Parameters
Parameter | Type |
---|---|
changeset | IChangeset |
Returns
CollaborationState
Overrides
CollaborationState.onRemoteChangeset
onRemoteRej()
onRemoteRej(): CollaborationState
Defined in: packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:491
Received a rejection from the server, meaning that conflict could be resolved by the algorithm.
Returns
CollaborationState
Overrides
CollaborationState.onRemoteRej
onRemoteRetry()
onRemoteRetry(): CollaborationState
Defined in: packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:495
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:602
Returns
void
Overrides
CollaborationState.resend
toggleOffline()
toggleOffline(): CollaborationState
Defined in: packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:499
Returns
CollaborationState
Overrides
CollaborationState.toggleOffline
toggleOnline()
toggleOnline(): CollaborationState
Defined in: packages/collaboration-client/src/controllers/collaboration/collaboration-state.ts:512
Returns
CollaborationState
Overrides
CollaborationState.toggleOnline