lgessler / glam

(WIP) a webapp for language documentation
Eclipse Public License 2.0
40 stars 3 forks source link

Replace realtime editing with lock-based editing for documents #22

Closed lgessler closed 8 months ago

lgessler commented 9 months ago

Motivation

Realtime editing of documents is cool, but complicates the implementation of other features such as NLP support, and it also has performance and correctness concerns which complicate implementation.

Proposed Feature

Realtime editing should be replaced by a lock-based system where up to one user may hold an editing lock on a document at any given time.

Some questions that need to be answered:

  1. How will change from the client be shared with the server as editing proceeds? Two obvious answers: first, the changes are accumulated on the client but not applied on the server, and when the user takes a "save" action, all changes are synchronized with the server; second, the changes are applied instantaneously on the server as they happen on the client. The latter is probably preferable, as it simplifies lock management.
  2. Lock-based systems are notorious for usability issues such as lock hogging ("Luke has been holding my lock since yesterday and he won't let it go!") and deadlock caused by correctness issues in the lock implementation. Appropriate measures must be taken to keep this system from being unusable.

Alternatives

There are probably other possible options but these are the two obvious ones.

Additional Context

People doing language documentation generally don't expect realtime collaboration, so it is not a great loss to give it up.