After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 375380 - Crashing when loading a modified NotOfTheDay
Crashing when loading a modified NotOfTheDay
Status: RESOLVED FIXED
Product: tomboy
Classification: Applications
Component: General
unspecified
Other All
: Normal critical
: ---
Assigned To: Tomboy Maintainers
Tomboy Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-11-15 02:07 UTC by Lauro Moura
Modified: 2008-02-26 20:46 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
Keeps the CreateDate read from the file instead of overwriting with DateTime.MinValue (540 bytes, patch)
2006-11-15 02:20 UTC, Lauro Moura
none Details | Review
Also prevents NoteOfTheDay from crashing Tomboy (1.17 KB, patch)
2006-11-15 19:29 UTC, Boyd Timothy
none Details | Review
Same as before except now logs error to Logger (1.33 KB, patch)
2006-11-15 19:42 UTC, Boyd Timothy
none Details | Review

Description Lauro Moura 2006-11-15 02:07:36 UTC
Steps to reproduce:
1. Edit a newly created NodD note (make tomboy save it by editing it)
2. Restart Tomboy
3. Tomboy crashes


Stack trace:
Unhandled Exception: System.Exception: A note with this title already exists
at Tomboy.NoteManager.Create (string,string) <0x0016d>
at NoteOfTheDay.Create (Tomboy.NoteManager,System.DateTime) <0x0004f>
at NoteOfTheDayPlugin.CheckNewDay (object,System.EventArgs) <0x00165>
at (wrapper delegate-invoke) System.MulticastDelegate.invoke_void_object_EventArgs (object,System.EventArgs) <0x00041>
at Tomboy.InterruptableTimeout.TimeoutExpired () <0x00019>
at (wrapper delegate-invoke) System.MulticastDelegate.invoke_bool () <0x00037>
at TimeoutProxy.Handler () <0x0002a>
at (wrapper native-to-managed) TimeoutProxy.Handler () <0x00036>
in (unmanaged) 0xb7f4edd5
at (wrapper managed-to-native) Gtk.Application.gtk_main () <0x00004>
at Gtk.Application.Run () <0x00007>
at Gnome.Program.Run () <0x00007>
at Tomboy.Application.StartMainLoop () <0x00014>
at Tomboy.Tomboy.StartTrayIcon () <0x00040>
at Tomboy.Tomboy.Main (string[]) <0x00128>


Other information:
Comment 1 Lauro Moura 2006-11-15 02:20:34 UTC
Created attachment 76616 [details] [review]
Keeps the CreateDate read from the file instead of overwriting with DateTime.MinValue

On Note.CreateExistingNote() the data.CreateDate property read from the disk was overwritten by DateTime.MinValue.

Then back on NoteOfTheDayPlugin.CheckNewDay() the NoteManager would find the saved note with a different creation date from today and would try to create a new note with the same name.
Comment 2 Boyd Timothy 2006-11-15 19:29:24 UTC
Created attachment 76667 [details] [review]
Also prevents NoteOfTheDay from crashing Tomboy

I also noticed this bug today.  This patch additionally adds a try/catch statement around the NoteOfTheDay code that calls NoteManager.Create () just in case it fails for other reasons; it will prevent Tomboy from crashing.
Comment 3 Boyd Timothy 2006-11-15 19:42:51 UTC
Created attachment 76669 [details] [review]
Same as before except now logs error to Logger

Applied this patch to latest CVS and checked-in.  This is now fixed.
Comment 4 Boyd Timothy 2006-11-16 03:58:48 UTC
Fixed in CVS Head.  Will be part of next release.