Make snapshots work again #236
Comments
Also, note that |
This is essentially downstream at http://trac.sagemath.org/ticket/8776 - in fact, there is even code there, though I'm not sure it will be useful or even solves the same problem. |
(However, the idea in http://trac.sagemath.org/ticket/5291 (which was perhaps never implemented) for making sure there aren't too many snapshots could be worth keeping if needed.) |
I have wonderful news! SNAPSHOTS DO WORK! They just aren't being _un_snapshotted correctly. Here are two different snapshots of a worksheet I just created.
|
Okay, here is a first thing. All one needs to do is in
with But there are two problems with this before it could actually be implemented - probably related.
In fact, I think both of the above are related to the user being
in sagenb/data/sage/html/notebook/base.html Anyway, I am pretty sure this is now solved; the rest is window-dressing, which I may not have time to do immediately. |
Here are a couple things that don't quite work for various reasons, but they are on the right path.
|
Interestingly, 'Revision History -- Previous sessions' doesn't seem quite right to see after one has reverted, since one can "revert" to saves in the future of the revision you reverted to. Also, the "Revision List" color needs to stand out more, maybe there is some css that can fix that. More annoyingly, I have just made the disturbing discovery that |
In fact, b0043f0 is where @mwhansen removed this. But it looks like this is different anyway - it seems to not be for adding to a list of actual worksheets, but rather to currently computed worksheets. Indeed, when you quit a worksheet it does
so that can't be it. But I suppose we should get rid of
is called every time |
Okay, I think I have a usable fix. Fixing the worksheet should be just a matter of the change above and then changing the worksheet name. Fixing the CSS is doable because the specific revision has a body id of |
See #247 - ready for review. |
(I wasn't able to get the bar of actions back in easily, but I think that is okay now that the revision list is clearer and separated a bit visually.) |
Fixed by #247 |
I have a question - how the snapshots are supposed to work? On my "work" server I observe the following: with 1 minute autosave interval there are no revisions. When I press "Save" there are still no revisions. When I press "Save & Quit", then open worksheet again and go to revisions, there are some which seem to coincide with me pressing either of two saving buttons. Is this expected behaviour? Any chance of writing some explanation of how things work/should work on the top of revisions page similar to how it is done for data, e.g. I create a file and see instructions Access 234 in this worksheet by typing DATA+'234'. Here DATA is a special variable that gives the exact path to all data files uploaded to this worksheet. |
Open a ticket here and I might be able to do this. "Save" should have worked properly, I believe. By the way, this is somewhat separate from the autosave, which is still apparently more or less broken. |
I got here from http://trac.sagemath.org/ticket/8776 and in both places the situation seems to be fixed, but unfortunately, in Sage 6.6, I still do not see the snapshots. Do I need to update something separately? Thanks for your work on this! |
Can you be more specific as to what isn't working? You do need to use the History tab, if memory serves. Also, it only takes a snapshot when you explicitly save (currently). |
Strange, if I click on "Save" or "Save and quit" now, I see a new revision when I then re-open and click on "Revisions". However, most of my worksheets have no revisions at all in the revision history. I'll keep in mind to save more often and then I'll watch if the revisions actually survive rebooting. Are they stored in the worksheet folder? Thanks for the quick reply! |
Interesting. I can't say for sure exactly why you are seeing that behavior; yes, they should be in the given folder, if I recall correctly (which I may not). |
Thanks, I found them. Each worksheet in sage_notebook.sagenb/home/admin/ has a subfolder snapshots if any snapshots were created. I can now see how a new .bz2 file is added to the folder when I click on save. However, for some reason the new snapshot does not show in the list when I then click on "Revisions" in the browser. Perhaps the contents of the snapshots directory are not refreshed frequently? |
That is more or less correct, you have to reload the page or reset the cache or something - I came across this in testing. I usually "Save and Quit" and then restart. Good luck! |
Currently, all snapshots made (exactly when they are made is a bit of a mystery, but see sagenb/flask_version/worksheet.py for the
@worksheet_command
s) are IDENTICAL to the last version of the worksheet. This is completely useless, and actually worse than useless because it is misleading to users. Many have complained. This happened about the time that autosaves were greatly reduced, but no one has yet found the source of this. Maybe now is the time.The text was updated successfully, but these errors were encountered: