Closed wlach closed 5 years ago
love this proposal will! :+1:
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?
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).
@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.
@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 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.
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.
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.
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.
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!)
Implementation details
Prior art