Posted: Fri Mar 21, 2014 6:14 pm Post subject: Fix for two versions for each save in OS X Versions browser
While looking at a document in the OS X Versions browser, I noticed that our code is saving two separate versions every time you save a document.
After looking at our code, I found that this was caused by a hack that I had used back in 2011 to ensure that the current document is also saved as a version.
I have reimplemented some of our versions code so that now, whenever you save a file, only one version will be displayed for that particular save in the Versions browser. Also, a version will be created when saving a new document. Previously, saving a new document would show no versions if the Versions browser and only after a second save would a document show a version.
The fix for this bug is in the following test patches:
Joined: Oct 24, 2005 Posts: 561 Location: Edinburgh, Scotland
Posted: Thu Mar 27, 2014 6:38 am Post subject:
I've installed Patch 0 Test 6.
I checked the behaviour before and after and can confirm what you say.
I don't really use versions, so I had to look up the Apple website to find out how to get to them. Is it possible/practical/worthwhile to get the NeoOffice menus to use the same wording as this Apple support document when using Mavericks?
I also played about with versions in TextEdit and note that it doesn't create a version when you first save a document either, it seems to wait until you subsequently edit the document before showing that there is a version to revert to. I can see the logic of this, but it would also seem to add complexity to the implementation, for little gain.
I don't really use versions, so I had to look up the Apple website to find out how to get to them. Is it possible/practical/worthwhile to get the NeoOffice menus to use the same wording as this Apple support document when using Mavericks?
I could change the existing File :: Revert To Saved menu item to be "Browse All Documents". Would that be more descriptive?
Unfortunately, my past attempts at change that menu item into a submenu on the fly and then back to the OpenOffice menu item that is normally in that slot have not worked. As a result, I made that one menu item display the Versions browser since any version can be restored from there.
amayze wrote:
I also played about with versions in TextEdit and note that it doesn't create a version when you first save a document either, it seems to wait until you subsequently edit the document before showing that there is a version to revert to. I can see the logic of this, but it would also seem to add complexity to the implementation, for little gain.
I usually like to adhere as close as possible to Apple's behavior, but their "no versions until the second save" behavior seems risky to me so the latest test patch implements a "when in doubt, save a version" approach.
The scenario that plays through my mind is a user creating a file on a shared folder and then a second user edits and overwrites that file. Since OS X stores versions on each user's machine, in such a scenario the first TextEdit user now has not only had their original file overwritten, but the original file cannot be recovered using the Versions browser.
Joined: Oct 24, 2005 Posts: 561 Location: Edinburgh, Scotland
Posted: Thu Mar 27, 2014 8:36 am Post subject:
pluby wrote:
I could change the existing File :: Revert To Saved menu item to be "Browse All Documents". Would that be more descriptive?
Hmm, without being in the context of File :: Revert To ::, I don't think "Browse All Documents" on it's own is any clearer. To me File :: Revert to Previous Version might make sense, but that's rather a lot of words! Or would "Browse All Versions" be ok?
pluby wrote:
Unfortunately, my past attempts at change that menu item into a submenu on the fly and then back to the OpenOffice menu item that is normally in that slot have not worked. As a result, I made that one menu item display the Versions browser since any version can be restored from there.
I thought there might be some underlying reason for there not being a submenu!
pluby wrote:
amayze wrote:
I also played about with versions in TextEdit and note that it doesn't create a version when you first save a document either, it seems to wait until you subsequently edit the document before showing that there is a version to revert to. I can see the logic of this, but it would also seem to add complexity to the implementation, for little gain.
I usually like to adhere as close as possible to Apple's behavior, but their "no versions until the second save" behavior seems risky to me so the latest test patch implements a "when in doubt, save a version" approach.
From what I could tell, TextEdit does, no versions until after first edit after first save, i.e. saving the document for the first time doesn't create a version, but as soon as you type anything new into the document the saved document is created as a version. However, your way is safer not likely to cause any confusion to users.
pluby wrote:
The scenario that plays through my mind is a user creating a file on a shared folder and then a second user edits and overwrites that file. Since OS X stores versions on each user's machine, in such a scenario the first TextEdit user now has not only had their original file overwritten, but the original file cannot be recovered using the Versions browser.
Patrick
Eek! I've justed tested this with TextEdit. If you create a new file and save it and immediately quite TextEdit, then when you relaunch and open the file there are still no versions available, so your scenario could indeed play out!
I've just found a crashing bug. I think I can reproduce it. Will post again in this thread with steps in a wee while.
Joined: Oct 24, 2005 Posts: 561 Location: Edinburgh, Scotland
Posted: Thu Mar 27, 2014 8:53 am Post subject:
Crashing bug:
1. Open Safari
2. Open NeoOffice
3. Select File :: Recent Documents :: [a file with versions]
4. Select File :: Revert to Saved
5. Click Done
6. Switch to Safari - the crash may happen now
7. Open TextEdit
8. Open a Document with versions
9. Select File :: Revert To :: Browse all Versions
10. Click Done
11. If the crash still hasn't occurred try switching between Safari and TextEdit with Ctrl-Tab - NeoOffice crashes eventually while in the background.
Here are some lines of Console output from the time I was reproaching the crash:
Hmm, without being in the context of File :: Revert To ::, I don't think "Browse All Documents" on it's own is any clearer. To me File :: Revert to Previous Version might make sense, but that's rather a lot of words! Or would "Browse All Versions" be ok?
"Browse All Versions..." is what I meant to say (I was typing the menu item name from memory as I was in Snow Leopard this morning). That is what TextEdit has so that is what I would use. Note: our code dynamically loads the Versions menu item name from TextEdit so that we get Apple's localizations. That also keeps our menu item name in sync with TextEdit's.
As for the crash, I cannot reproduce it on my Mac OS X 10.9.2 machine using a Writer document. Is it possible for you to attach the crash log? If there is a crash log, you will find it using the following steps:
1. Open the /Application/Utilities/Terminal application, enter the following command and press the Return key:
Code:
open /Library/Logs/DiagnosticReports
2. In the Finder window that opens, scroll to the files that start with "soffice.bin_" and attach the file with the date and time of one of the crashes
If there is no soffice.bin_* crash logs files, let us know.
Patrick
Last edited by pluby on Thu Mar 27, 2014 8:13 pm; edited 1 time in total
Thank you for the crash log. From the crash log, I think that I know what is causing the crash that you see and I have added some code to check for the conditions that I think trigger the crash.
I have also changed the File :: Revert to Saved menu item to use Apple's localized "Browse All Versions" menu item text.
Lastly, I found that File :: Save was not localized on Mavericks because at some point Apple removed the "Save a Version" localized menu item text that was in Mac OS X 10.7 Lion. In such cases, I use Apple's localized "Save" menu item text.
The changes are in the following test patches. Does the crashing still occur for you?:
Joined: Oct 24, 2005 Posts: 561 Location: Edinburgh, Scotland
Posted: Fri Mar 28, 2014 8:12 am Post subject:
I've installed Patch 0 Test 7.
I think my steps for the crash were over complicated. Just having NeoOffice in the background is enough for it to fail. Also the document I was opening had only one version saved in it. I don't know if that is significant.
That is good to hear. The crashing was due to an empty path being passed to the "save a version" code so I just added a check that if the path is not valid, then skip that code.
amayze wrote:
Also the menu items make more sense now.
I have taken updated screen snapshots of the File menu and I will update the Versions feature description on the main website to match.
I plan on releasing NeoOffice 3.4.1 Patch 1 early next week with the changes so if you find any more crashing bugs or issues, please let us know. I will wait a couple of weeks after the patch is released before pushing the same changes to the Mac App Store so even if you find problems after the patch is released, let us know and we can fix and issue a new patch fairly quickly.
FYI. I have included the fix for duplicate versions and crashing bugs and included the updated File menu item text changes in NeoOffice 3.4.1 Patch 1 which can be downloaded from the NeoOffice patch download page.
FYI. I have included the fix for duplicate versions and crashing bugs and included the updated File menu item text changes in NeoOffice 2013.3 which is available in Apple's Mac App Store.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum