-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New revisions should be marked as "draft", and should automatically prune drafts #2451
Comments
@zzl0 is interested in taking this on |
@wlach thanks for creating this issue |
Hi William, Good morning, after thinking more about this issue, I have some questions about current proposal:
|
Good questions!
Maybe "redundant" is not the best term -- perhaps "excessive" would be better. You are correct that there should be a small difference between every two revisions, but the amount of changes a user can make within one minute is not too great. For the purpose of keeping a paper trail, I think keeping a persistent log of changes at one minute intervals should be sufficient. We can always tweak the exact values depending on user feedback.
I think this might be an interesting thing to do (it's what e.g. Google Docs does), though I think this will solve some of the same problems and is worth working on, on its own.
1 minute should cut down the number of revisions down by half (or more, if we start saving more frequently which I think would be a logical followup)
Ah yes, I should have described that in more detail. In iodide we use spinach (a python library like celery, if you've used that) to schedule tasks outside of user interaction. You can see an example of this here: https://github.com/iodide-project/iodide/blob/master/server/files/tasks.py |
Thank you @wlach for the detailed explanation! Sounds good to me, I will continue working on this. |
Currently we save new revisions of each iodide notebook every 30 seconds:
iodide/src/editor/actions/autosave-actions.js
Line 6 in 6f3d61d
This leads to a lot of redundant revisions in notebooks with even a modest amount of history, which can make the history viewer hard to use. We should probably put a cap on the number of revisions we save to one per minute -- this would also let us save even more frequently.
I propose doing this by adding "draft" revisions. Draft revisions are subject to being deleted/replaced until they are at least a minute old.
Proposal:
iodide/server/notebooks/models.py
Line 36 in 6a9c68f
** Get a list of all "draft" revisions
** Make sure that all draft revisions are spaced at least one minute apart. If there any draft revisions within the same minute interval, delete them.
** After this process is complete, mark any draft revisions more than a minute old as being non-draft.
server/tests/
: https://github.com/iodide-project/iodide/tree/master/server/testsThis is not a comprehensive set of things that need to be done but should be enough to get started. :)
The text was updated successfully, but these errors were encountered: