Re: Bunch of CoreData based NSDocument questions.
Re: Bunch of CoreData based NSDocument questions.
- Subject: Re: Bunch of CoreData based NSDocument questions.
- From: Quincey Morris <email@hidden>
- Date: Sun, 29 Nov 2015 15:15:24 -0800
- Feedback-id: 167118m:167118agrif8a:167118sTKIFfjZPa:SMTPCORP
On Nov 29, 2015, at 14:21 , Graham Cox <email@hidden> wrote:
>
> If you don’t clear your undo stack on save, then it’s possible to undo past the last save point.
IIRC the context was that Motti proposed autosaving by doing a Core Data “save” operation, which writes the in-memory Core Data state to the database, then if the document was eventually closed without saving it would be possible to “roll back” the change by undoing everything since the change.
My position is that this is too dangerous — if the app crashes after such a save, you can’t recover the last document-saved state of the database, which is something earlier than the last Core Data save.
On Nov 29, 2015, at 14:41 , Ben Kennedy <email@hidden> wrote:
>
> More specifically: open an image in Preview; crop it arbitrarily; then quit. Go look at the source file on disk -- it has been irreparably damaged: the crop was immediately saved!
>
> Re-launch Preview, and observe that there is no way to undo this damage. As far as I can tell, one is forced to dig in to the Time Machine BS in order to resurrect the file.
>
> This seems inconsistent with your description above: not only does Quit imply a Save, but there is no way to recover from it undo-wise, either.
It’s a bug…
On Nov 29, 2015, at 15:00 , Shane Stanley <email@hidden> wrote:
>
> System Preferences -> General, check "Ask to keep changes when closing documents".
Part of the confusion comes from that preferences setting. (Mine was turned off, and I don’t recall ever turning it off myself.)
But there’s still a terrible, terrible bug. Even with that setting on, you can quit without getting a do-you-want-to-save dialog, and the document is actually saved, instead of just being autosaved. When you relaunch, state restoration causes the document to *say* it’s dirty, but it’s not really, and you can’t revert to the correct version. This is *not* supposed to happen.
What’s supposed to happen on Quit is that the document is *autosaved*, not save, so when you re-launch it’s dirty but revertible. (Undo can’t help, because most apps don’t preserve the undo chain across relaunches. That’s nothing to do with the document system.)
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden