Skip to content
This repository has been archived by the owner on Oct 8, 2022. It is now read-only.

Synchronization Protocol

Lucas Satabin edited this page Dec 3, 2013 · 11 revisions

This protocol is derived from the original mobwrite protocol by Neil Fraser.

Messages

The protocol uses json messages to communicate between peers. This section describes these messages.

Synchronization Session

A synchronization session is a message that allows people to work on files for a given paper identifier. It is composed of the name of the peer sending the message, the paper identifier on which we are working and a list of synchronization commands to apply to files in this paper

For example:

{
  "peerId": "toto",
  "paperId": "v987fed987da70987f",
  "commands": [
    [ "file1.tex", 432767, <command> ],
    [ "file2.tex", 87432, <command> ]
  ]
}

The synchronization commands work on a specific file of the paper at a specific revision. Thus they all are associated to a filename and a revision. The commands are described below.

Synchronization Command

The following commands are available:

  • send delta to the peer
{
  "name": "delta",
  "revision": 4324523,
  "data": [ "=100", "-2", "+test", "=34" ],
  "overwrite": false
}
  • send raw text to the peer
{
  "name": "raw",
  "revision": 4324523,
  "data": "Complete raw text",
  "overwrite": false
}
  • send paper deletion request to the peer
{
  "name": "nullify"
}
  • send some use message to broadcast to all connected peers
{
  "name": "message",
  "json": <json value>
}
Clone this wiki locally