Skip to content

Collaborative script editing #889

@Tim020

Description

@Tim020

Right now, only one user at a time can edit the script and all edit state is stored locally in the users browser. This is not ideal for a couple of reasons:

  1. Not a collaborative environment
  2. A crash/reload/refresh of the editing user's browser would cause all edits to be lost

Therefore, it would be a good enhancement to make the script editing colaborative with a more robust state management system. We can utilise the existing websocket infrastructure for communicating between clients via the server to show up to date edit information to each editing user. Further, we can look at storing the draft version of the script (before save) on the backend somewhere - either in the DB or perhaps as a simple JSON file on disk, which can then be used as a protection against the state loss problem.

Problems we need to solve are:

  1. How should the view look for multiple people - if one person has a line open for editing should this be reflected across all clients, or should the other clients only get the line updated when the user clicks done on that line?
  2. How do we perform conflict resolution if two users try and edit the same line at the same time?
  3. Who is responsible for performing the eventual save of the script from draft state, and when should this happen?
  4. What happens if a user becomes disconnected before they are able to sync their changes to the server, and how do we handle conflict resolution when they reconnect? At the moment, since state is stored locally, if they disconnect it would get cleared out anyway so perhaps not a problem, but something to consider.
  5. How does this interact with the revision system? What would happen if we created a new revision, or loaded a different revision, whilst the script was being edited? (Easy solution - block this action)
  6. What do we do if we don't save a draft script, say all users exit edit mode without saving, what happens next?

Metadata

Metadata

Assignees

No one assigned

    Labels

    clientPull requests changing front end codeserverPull requests changing back end code

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions