Expand all

ve.dm.RebaseClient

Constructor

new ve.dm.RebaseClient() #

DataModel rebase client

Source:
DataModel rebase client

Properties

addToHistoryabstract #

Add a change to history, without applying it to the surface

Source:
Add a change to history, without applying it to the surface

applyChangeabstract #

Apply a change to the surface, and add it to the history

Source:
Apply a change to the surface, and add it to the history

authorId #

Properties:

Name Type Description
authorId number

Author ID

Source:

backtrack #

Properties:

Name Type Description
backtrack number

Number of transactions backtracked (i.e. rejected) since the last send

Source:

commitLength #

Properties:

Name Type Description
commitLength number

Offset up to which we know we have no differences with the server

Source:

getChangeSinceabstract #

removeFromHistoryabstract #

Remove a change from history, without unapplying it to the surface

Source:
Remove a change from history, without unapplying it to the surface

sendChangeabstract #

sentLength #

Properties:

Name Type Description
sentLength number

Offset up to which we have no unsent changes

Source:

unapplyChangeabstract #

Unapply a change from the surface, and remove it from the history

Source:
Unapply a change from the surface, and remove it from the history

Methods

acceptChange(change) #

Accept a committed change from the server

If the committed change is by the local author, then it is already applied to the document and at the correct point in history: just move the commitLength pointer.

If the commited change is by a different author, then:

  • Rebase local uncommitted changes over the committed change
  • If there is a rejected tail, then apply its inverse to the document
  • Apply the rebase-transposed committed change to the document
  • Rewrite history to have the committed change followed by rebased uncommitted changes

Parameters:

Name Type Description
change ve.dm.Change

The committed change from the server

Source:

Accept a committed change from the server

If the committed change is by the local author, then it is already applied to the document and at the correct point in history: just move the commitLength pointer.

getAuthorId() → {number} #

Source:

Returns:

Author ID

Type
number

logEvent(event) #

Add an event to the log. Default implementation does nothing; subclasses should override this if they want to collect logs.

Parameters:

Name Type Description
event Object

Event data

Source:
Add an event to the log.

setAuthorId(authorId) #

Parameters:

Name Type Description
authorId number

Author ID

Source:

submitChange() #

Submit all outstanding changes

This will submit all transactions that exist in local history but have not been broadcast by the server.

Source:

Submit all outstanding changes

This will submit all transactions that exist in local history but have not been broadcast by the server.