Skip to content

Presence for OT Types #29

Open
Open
@curran

Description

@curran

Presence, meaning for example where others' cursors are, is an essential feature of real time collaborative systems. Without it, the experience of real time collaboration suffers greatly. When it comes to implementing presence, one of the tricky bits is transforming presence by ops. Since various OT types will transform presence in different ways, it makes sense to have each OT type define its own presence data structure and transformation algorithm.

This work has been underway for some time now, but I wanted to make this issue to discuss the core of the work - namely, whether or not this feature stands a chance at becoming an "official" part of the OT implementation recommendataion/docs within the ottypes organization. This would be an improvement over the current situation, where the feature is implemented and maintained solely in a fork or multiple divergent forks.

This PR Add presence-related properties #27 introduces the following new methods:

  • createPresence([initialData]) -> presence: (optional) Creates a valid presence from some initialData. Presence represents a user and may contain details like user ID, cursor position in a text OT type, etc.
  • transformPresence(presence, op, isOwnOp) -> presence': (optional) Transforms the presence by the op to create a new presence' which is adjusted in some way for the effects of the op. For example, a cursor position may be pushed forward, if the op inserts some text at the beginning of a text document. isOwnOp determines if the operation comes from the owner of the presence, or from another user.
  • comparePresence(presence1, presence2) -> boolean: (optional) Compares presence1 to presence2 and returns true, if they are equal, otherwise returns false.

I personally am only totally convinced that we need transformPresence(presence, op). The experience of actually implementing the feature may prove the need for the others.

Related reading:

With this issue I'd like to open a discussion about high level questions around presence, like:

  • Does it make sense (is it really necessary) to add presence awareness to OT types?
  • Is presence a feature that the ottypes body of work should support?
  • If this standardization gets sorted out in ottypes, can mainline ShareDB be made to support it?

/cc @josephg @nateps @ericyhwang @gkubisa @mdaines @houshuang @jhchen

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions