I think this is a regression. When you delete a note from the notes list, for which a editor window is open, the editor remains open. It should close, when the note gets deleted. When you switch back to the notes and press ESC it will create a new note. When you go back and press Ctrl+Del instead it will crash with the following error:
---------------------------
Error
---------------------------
class err::LogicException
Postcondition failed:
app::model::data::NoteMapper::getNote
n
---------------------------
OK
---------------------------
Thomas
[log.1.txt]
Timestamp Thread Forced Function Details
8:57:57.354384 3356 logging::Log::init Started logging
8:57:57.354384 3356 X ui::wndProc ERROR:class err::LogicException
Postcondition failed:
app::model::data::NoteMapper::getNote
n
Crash after deleting note
-
- Posts: 1324
- Joined: Tue Mar 08, 2011 11:15 am
- CintaNotes Developer
- Site Admin
- Posts: 5002
- Joined: Fri Dec 12, 2008 4:45 pm
- Contact:
Re: Crash after deleting note
Hi Thomas,
Thanks for the report!
I've just tested and it seems that the problem was always present (at least since CintaNotes 2.3), although in a slightly different form:
Ctrl+Del in the editor did nothing, and second Ctrl+Del displayed "Can't start a transaction within a transaction" message.
I also don't quite agree that the dialog should immediately close. I think this should be the case only if there are no unsaved changes, otherwise the dialog should remain open, and work as if the edited note was a new note. What do you think?
Thanks for the report!
I've just tested and it seems that the problem was always present (at least since CintaNotes 2.3), although in a slightly different form:
Ctrl+Del in the editor did nothing, and second Ctrl+Del displayed "Can't start a transaction within a transaction" message.
I also don't quite agree that the dialog should immediately close. I think this should be the case only if there are no unsaved changes, otherwise the dialog should remain open, and work as if the edited note was a new note. What do you think?
Alex
-
- Posts: 1324
- Joined: Tue Mar 08, 2011 11:15 am
Re: Crash after deleting note
Alex,
i remember we had a similar talk before, but don't remember the details. I don't want to stress this issue. Either way is ok. So yes, saving the (just deleted) note, in case there are unsaved changes is one of the possibilities. In the end it is most important not to crash, whatever the solution is.
Thomas
i remember we had a similar talk before, but don't remember the details. I don't want to stress this issue. Either way is ok. So yes, saving the (just deleted) note, in case there are unsaved changes is one of the possibilities. In the end it is most important not to crash, whatever the solution is.
Thomas
- CintaNotes Developer
- Site Admin
- Posts: 5002
- Joined: Fri Dec 12, 2008 4:45 pm
- Contact:
Re: Crash after deleting note
The easiest solution would be just to disable Ctrl+Del for notes which don't exist in the database.
Alex
-
- Posts: 1324
- Joined: Tue Mar 08, 2011 11:15 am
Re: Crash after deleting note
CintaNotes Developer wrote:The easiest solution would be just to disable Ctrl+Del for notes which don't exist in the database.
In that case any already opened editor needed to be notified about any deletion to check it might be affected.
Thomas
- CintaNotes Developer
- Site Admin
- Posts: 5002
- Joined: Fri Dec 12, 2008 4:45 pm
- Contact:
Re: Crash after deleting note
No need - it should just check if the note is still in the db upon Ctrl+Del press
Alex
-
- Posts: 1324
- Joined: Tue Mar 08, 2011 11:15 am
Re: Crash after deleting note
CintaNotes Developer wrote:No need - it should just check if the note is still in the db upon Ctrl+Del press
Ok, so it is not about disabling the shortcut, but ignoring it instead. However, will the user understand that pressing the key - all the sudden - does not react? After all the user already deleted the note from the list, then realizes it is still there (in the open editor) and tries to eventually get rid of it! That is why i argued that the editor should be closed, when the note gets deleted from the list. Regardless of any changes.
Thomas
- CintaNotes Developer
- Site Admin
- Posts: 5002
- Joined: Fri Dec 12, 2008 4:45 pm
- Contact:
Re: Crash after deleting note
Thomas Lohrum wrote:Ok, so it is not about disabling the shortcut, but ignoring it instead. However, will the user understand that pressing the key - all the sudden - does not react? After all the user already deleted the note from the list, then realizes it is still there (in the open editor) and tries to eventually get rid of it! That is why i argued that the editor should be closed, when the note gets deleted from the list
Probably then the best solution would be to close the editor, but if there are any unsaved changes display an additional warning?
Alex
-
- Posts: 1324
- Joined: Tue Mar 08, 2011 11:15 am
Re: Crash after deleting note
CintaNotes Developer wrote:Probably then the best solution would be to close the editor, but if there are any unsaved changes display an additional warning?
I guess you mean something like "This note does contain unsaved changes. Are you sure you want to delete it?"
Thomas
- CintaNotes Developer
- Site Admin
- Posts: 5002
- Joined: Fri Dec 12, 2008 4:45 pm
- Contact:
Re: Crash after deleting note
Thomas Lohrum wrote:I guess you mean something like "This note does contain unsaved changes. Are you sure you want to delete it?"
Yes, exactly. Before CN deletes any notes, it will run through all notes that are currently open in the editor, and if they have unsaved changes, it will ask for additional confirmation.
Another option that is probably less bothering for the user is to silently save the changes and move the note to the Recycle Bin (even when Shift+Del was pressed).
We need to decide which one is better:)
Alex
-
- Posts: 1324
- Joined: Tue Mar 08, 2011 11:15 am
Re: Crash after deleting note
CintaNotes Developer wrote:Yes, exactly. Before CN deletes any notes, it will run through all notes that are currently open in the editor, and if they have unsaved changes, it will ask for additional confirmation. Another option that is probably less bothering for the user is to silently save the changes and move the note to the Recycle Bin (even when Shift+Del was pressed). We need to decide which one is better:)Thomas Lohrum wrote:I guess you mean something like "This note does contain unsaved changes. Are you sure you want to delete it?"
Alex,
i like your idea of taking care of the issue silently. However i have just tested what happens when i try to delete a changed note in the editor. A dialog warns me about the change and asks whether i really want to discard the changes. Thus it makes sense to ask for confirmation. First it matches the behaviour inside the editor. Second it also handles the issue, when Shift+Del was pressed. Btw. currently deleting a note from inside the editor will always move it to recycle bin. Personally i don't care. I've just got aware of this inconsistency. On the other hand the different shortcuts to delete a note (Del, Ctrl+Del) are a inconsistency on their own.
Thomas
- CintaNotes Developer
- Site Admin
- Posts: 5002
- Joined: Fri Dec 12, 2008 4:45 pm
- Contact:
Re: Crash after deleting note
Hi Thomas,
I guess you're right, thanks. I've planned the fix for this for version 2.8.2 (did not make it into 2.8.1).
About the inconsistency - I'm afraid there will be no way to get rid of it, because using simple Del
to delete notes in the notes list is very convenient, however out of the question for the editor.
Thomas Lohrum wrote:Thus it makes sense to ask for confirmation.
I guess you're right, thanks. I've planned the fix for this for version 2.8.2 (did not make it into 2.8.1).
About the inconsistency - I'm afraid there will be no way to get rid of it, because using simple Del
to delete notes in the notes list is very convenient, however out of the question for the editor.
Alex