iodide-project / iodide

Literate scientific computing and communication for the web
Mozilla Public License 2.0
1.49k stars 141 forks source link

Move to a glitch/etherpad/gdocs-like autosave model #1037

Closed wlach closed 5 years ago

wlach commented 5 years ago

The "explicit save" model is so 2003. Let's have the autosave experience that users expect these days.

Goals

(note: not all of these will necessarily be implemented for the first pass!)

  1. Allow "save-as-you-type" functionality
  2. Allow multiple users to concurrently modify a notebook
  3. Allow a user to propose a set of changes to be merged back into a source notebook
  4. Allow tracking which users are responsible for which revisions to a notebook

Implementation details

Prior art

bcolloran commented 5 years ago

love this proposal will! :+1:

hamilton commented 5 years ago

Every 30 seconds, if there are any changes to the document, client will attempt to contact server and submit its changes vs. the last known server revision

@wlach would the idea be to reduce that delta down as low as possible to make way for real-time collaboration?

wlach commented 5 years ago

Actually, yeah, 30 seconds is too infrequent. :) Let's see if we can't get realtime collaboration going using django channels. Seems like etherpad uses socket.io for this (basically the node equivalent).

hamilton commented 5 years ago

@wlach Yes, that seems right - kind of a canonical web sockets use case.

Solving this issue will also require solving #916 (notifying user of a severed connection), though I think we'll get most of the way toward that issue once we have the machinery in-place for this issue.

hamilton commented 5 years ago

@wlach here's a strange idea. What if we also enqueue evaluation? So I receive both the document and the steps toward reproducing the current state. As an opening bid, we don't validate state, and perhaps we maintain that we don't validate state going forward.

This could be an option that is toggle-able, so not the default. I can see use cases for this in collaborative editing (maintaining something along the lines of a similar eval history, if not kernel state which is a much harder problem), teaching that allows the driver to also explore things on their own in some way, etc.

wlach commented 5 years ago

@wlach here's a strange idea. What if we also enqueue evaluation? So I receive both the document and the steps toward reproducing the current state. As an opening bid, we don't validate state, and perhaps we maintain that we don't validate state going forward.

Interesting idea, I'm not quite sure how to present a specific set of evaluation steps to the user in an intuitive way though. I suspect that with iodide notebooks, because they are re-evaluated so often, there will strong pressure for them to be runnable in linear order.

hamilton commented 5 years ago

I think the evaluation steps would simply appear in the console, and the notebook gets them entirely from the server in that instance, and the server communicates the queue to the connected notebooks, and the notebook itself is responsible for the evaluation. So long as its in the console, I can see it being pretty easy to see who has evaluated what.

Also to be clear I don't think this is probably in-scope but I added the proposal label to this so we can talk freely about any hair-brained ideas, so here we are.

The OP feels like the right set of requirements and constraints.

wlach commented 5 years ago

I still want to do this but am going to put it on hold for a short while, as I attack lower hanging fruit. The new autosave implementation (#1131) goes some way to solving some real pain points which motivated this work.

wlach commented 5 years ago

Let's close this bug, we've implemented much of it, and our discussion/thinking in this area has evolved so that much of the discussion of the remainder is obsolete.