josephg / ShareJS

Collaborative editing in any app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Conflict Indication

vmakhaev opened this issue · comments

Can we have some exception or error in case of conflict?

Example:
Two clients do set operation at same time to same document, one of these two ops is apply and one is lost. Can client, which op is lost receive some notification? Maybe it can be some kinds of exceptions for different conflicts.

Both are applied. The doctype defines how the op will be transformed to
take into account other ops that were already applied.

This could mean that the op is transformed into a no-op, but again this is
defined by the specific doctype you are using.

On Sun, Oct 6, 2013 at 6:53 AM, vmakhaev notifications@github.com wrote:

Can we have some exception or error in case of conflict?

Example:
Two clients do set operation at same time to same document, one of these
two ops is apply and one is lost. Can client, which op is lost receive some
notification? Maybe it can be some kinds of exceptions for different
conflicts.


Reply to this email directly or view it on GitHubhttps://github.com//issues/259
.

Is it applied for json doctype? At the moment there is no conflict indication at derby.js. Where is should be added? At share.js or at racer?

Which set operation 'wins', and which set operation causes an error? If the answer is the 'first' set operation wins, then different operations will win on the client and server. If the first operation to reach the server wins, ... well, thats possible - The transform function could throw an error when it sees concurrent set operations on the server and throw an error. You can make your own JSON OT code to do this and replace the version derby currently uses.

However, I don't want that to be the default behaviour. Fork ottypes and put your changes in your fork. The API is stable enough that it should be easy to maintain.