-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
clientPull requests changing front end codePull requests changing front end codeserverPull requests changing back end codePull requests changing back end code
Description
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:
- Not a collaborative environment
- 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:
- 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?
- How do we perform conflict resolution if two users try and edit the same line at the same time?
- Who is responsible for performing the eventual save of the script from draft state, and when should this happen?
- 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.
- 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)
- What do we do if we don't save a draft script, say all users exit edit mode without saving, what happens next?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
clientPull requests changing front end codePull requests changing front end codeserverPull requests changing back end codePull requests changing back end code