Welcome to NeoOffice developer notes and announcements
NeoOffice
Developer notes and announcements
 
 

This website is an archive and is no longer active
NeoOffice announcements have moved to the NeoOffice News website


Support
· Forums
· NeoOffice Support
· NeoWiki


Announcements
· Twitter @NeoOffice


Downloads
· Download NeoOffice


  
NeoOffice :: View topic - Fix for two versions for each save in OS X Versions browser
Fix for two versions for each save in OS X Versions browser
 
   NeoOffice Forum Index -> NeoOffice Testing
View previous topic :: View next topic  
Author Message
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: 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:

NeoOffice 3.4.1:
http://nick.neooffice.org/test/NeoOffice-3.4.1-Patch-0-Test-6-Intel.dmg

NeoOffice 2013.2:
http://nick.neooffice.org/test/NeoOffice-2013.2-Test-6-Intel.dmg

Patrick
Back to top
amayze
The Merovingian


Joined: Oct 24, 2005
Posts: 561
Location: Edinburgh, Scotland

PostPosted: 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.

Andy
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Thu Mar 27, 2014 7:39 am    Post subject:

amayze wrote:
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.

Patrick
Back to top
amayze
The Merovingian


Joined: Oct 24, 2005
Posts: 561
Location: Edinburgh, Scotland

PostPosted: 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.

Andy
Back to top
amayze
The Merovingian


Joined: Oct 24, 2005
Posts: 561
Location: Edinburgh, Scotland

PostPosted: 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:
Code:
27/03/2014 15:33:07.026 com.apple.appkit.xpc.VersionsUIHelper[4171]: PSsetwindowlevel, error setting window level (1001)
27/03/2014 15:33:14.942 com.apple.launchd.peruser.502[266]: (org.neooffice.NeoOffice.41568[4201]) Job appears to have crashed: Abort trap: 6
27/03/2014 15:37:32.608 com.apple.appkit.xpc.VersionsUIHelper[4295]: PSsetwindowlevel, error setting window level (1001)
27/03/2014 15:38:06.673 com.apple.appkit.xpc.VersionsUIHelper[4327]: PSsetwindowlevel, error setting window level (1001)
27/03/2014 15:38:43.282 com.apple.launchd.peruser.502[266]: (org.neooffice.NeoOffice.41568[4284]) Job appears to have crashed: Abort trap: 6
27/03/2014 15:38:44.259 com.apple.appkit.xpc.VersionsUIHelper[4327]: PSsetwindowlevel, error setting window level (1001)
27/03/2014 15:40:52.818 com.apple.appkit.xpc.VersionsUIHelper[4395]: PSsetwindowlevel, error setting window level (1001)
27/03/2014 15:41:08.113 com.apple.launchd.peruser.502[266]: (org.neooffice.NeoOffice.41568[4384]) Job appears to have crashed: Abort trap: 6
27/03/2014 15:45:54.652 com.apple.appkit.xpc.VersionsUIHelper[4469]: PSsetwindowlevel, error setting window level (1001)
27/03/2014 15:46:32.072 com.apple.appkit.xpc.VersionsUIHelper[4498]: PSsetwindowlevel, error setting window level (1001)
27/03/2014 15:46:56.407 com.apple.launchd.peruser.502[266]: (org.neooffice.NeoOffice.41568[4459]) Job appears to have crashed: Abort trap: 6


Andy
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Thu Mar 27, 2014 3:35 pm    Post subject:

amayze wrote:
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
Back to top
amayze
The Merovingian


Joined: Oct 24, 2005
Posts: 561
Location: Edinburgh, Scotland

PostPosted: Thu Mar 27, 2014 4:11 pm    Post subject:

pluby wrote:

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?


It's there after the lines of console output.

Andy
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Thu Mar 27, 2014 8:52 pm    Post subject:

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?:

NeoOffice 3.4.1:
http://nick.neooffice.org/test/NeoOffice-3.4.1-Patch-0-Test-7-Intel.dmg

NeoOffice 2013.2:
http://nick.neooffice.org/test/NeoOffice-2013.2-Test-7-Intel.dmg

Patrick
Back to top
amayze
The Merovingian


Joined: Oct 24, 2005
Posts: 561
Location: Edinburgh, Scotland

PostPosted: 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.

So far it's not crashing with Test 7.

Also the menu items make more sense now.

Thanks,

Andy
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Fri Mar 28, 2014 8:33 am    Post subject:

amayze wrote:
So far it's not crashing with Test 7.


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.

Patrick
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Sun Mar 30, 2014 11:44 am    Post subject:

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.

Patrick
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Tue Apr 15, 2014 10:08 pm    Post subject:

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.

Patrick
Back to top
Display posts from previous:   
   NeoOffice Forum Index -> NeoOffice Testing All times are GMT - 7 Hours
Page 1 of 1

 
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

Powered by phpBB © 2001, 2005 phpBB Group

All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest © Planamesa Inc.
NeoOffice is a registered trademark of Planamesa Inc. and may not be used without permission.
PHP-Nuke Copyright © 2005 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.