Version: 3.5 (using KDE 3.5.1, compiled sources) Compiler: gcc version 3.4.3 OS: Linux (i686) release 2.6.7 A very serious problem, as the user sees newly entered data which is never saved. I have a localdir resource. When I add on 1 day 2 events, delete them again, add a third one, the third one is not written to disk! (but is still displayed in the calendar!!) My tests show that this only happens after 2 deletes. When I only add 1, delete it, add 1, it works. I activated debug flag 5800: Here is what I get: I add incidence 'aaa': libkcal: CalendarResources::addIncidence0x83667b8 libkcal: CalendarResources::beginChange() libkcal: CalendarResources::requestSaveTicket() libkcal: CalendarResource::endChange() libkcal: CalendarResources::save( Ticket *) libkcal: tick localdir resource libkcal: Save resource localdir resource libkcal: writing '/root/.kde/share/apps/korganizer/cal_dir//KOrganizer-1357684282.490' libkcal: ICalFormat::save(): /root/.kde/share/apps/korganizer/cal_dir//KOrganizer-1357684282.490 libkcal: Write recurrence for 'aaa' (KOrganizer-1357684282.490) libkcal: CalendarResource::endChange() korganizer: ERROR: Can't decrement change count. It already is 0. libkcal: CalendarResources::save( Ticket *) I delete it: libkcal: CalendarResources::beginChange() libkcal: CalendarResources::requestSaveTicket() libkcal: CalendarResources::deleteEvent libkcal: ResourceLocalDir::deleteEvent libkcal: CalendarResource::endChange() I add a second one (this is now saved) 'bbb': libkcal: CalendarResources::addIncidence0x83667b8 libkcal: CalendarResources::beginChange() libkcal: CalendarResource::endChange() libkcal: CalendarResource::endChange() libkcal: CalendarResources::save( Ticket *) libkcal: tick localdir resource libkcal: Save resource localdir resource libkcal: writing '/root/.kde/share/apps/korganizer/cal_dir//KOrganizer-1800438583.601' libkcal: ICalFormat::save(): /root/.kde/share/apps/korganizer/cal_dir//KOrganizer-1800438583.601 libkcal: Write recurrence for 'bbb' (KOrganizer-1800438583.601) I add another one (which is also saved) 'ccc': libkcal: CalendarResources::addIncidence0x83667b8 libkcal: CalendarResources::beginChange() libkcal: CalendarResources::requestSaveTicket() libkcal: CalendarResource::endChange() libkcal: CalendarResources::save( Ticket *) libkcal: tick localdir resource libkcal: Save resource localdir resource libkcal: writing '/root/.kde/share/apps/korganizer/cal_dir//KOrganizer-1225803500.72' libkcal: ICalFormat::save(): /root/.kde/share/apps/korganizer/cal_dir//KOrganizer-1225803500.72 libkcal: Write recurrence for 'ccc' (KOrganizer-1225803500.72) libkcal: CalendarResource::endChange() korganizer: ERROR: Can't decrement change count. It already is 0. libkcal: CalendarResources::save( Ticket *) I delete 'ccc' and 'bbb': libkcal: CalendarResources::beginChange() libkcal: CalendarResources::requestSaveTicket() libkcal: CalendarResources::deleteEvent libkcal: ResourceLocalDir::deleteEvent libkcal: CalendarResource::endChange() libkcal: CalendarResources::beginChange() libkcal: CalendarResources::deleteEvent libkcal: ResourceLocalDir::deleteEvent libkcal: CalendarResource::endChange() Now I add another one 'ddd' which is NOT SAVED: libkcal: CalendarResources::addIncidence0x83667b8 libkcal: CalendarResources::beginChange() libkcal: CalendarResource::endChange() libkcal: CalendarResource::endChange()
Looking for the bug in the code, I found something: When an Incidence is deleted, beginChange() is called before deleteEvent() and then endChange(). In beginChange() a change counter (associated with the Resource the incidence is in) is increased, but in endChange(), the resource the now deleted incidence was in, is no longer found (which is obvious) which leads to the fact, that the changeCounter can not be decreased anymore. Which further leads to the fact that with the next creation of an incidence the change counter is not set to 0 in endChange() which then does not trigger the save() method. Adding additional debug outputs shows: libkcal: CalendarResources::beginChange() 0x8605590 libkcal: int KCal::CalendarResources::incrementChangeCount(KCal::ResourceCalendar*) change count=1 libkcal: CalendarResources::requestSaveTicket() libkcal: CalendarResources::deleteEvent libkcal: ResourceLocalDir::deleteEvent libkcal: CalendarResource::endChange() 0x8605590 libkcal: CalendarResources::beginChange() 0x82bef48 libkcal: int KCal::CalendarResources::incrementChangeCount(KCal::ResourceCalendar*) change count=2 libkcal: CalendarResources::deleteEvent libkcal: ResourceLocalDir::deleteEvent libkcal: CalendarResource::endChange() 0x82bef48 As I don't know what is the concept behind the changeCounter, I can't quickly create a solution. Probably someone can do it with my findings ...
Reassigning all KOrganizer bug reports and wishes to the newly created korganizer-devel mailing list.
I confirm frequent data loss (event and todos) with KOrganizer. Items are ok on the screen, but if I quit and start kontact those items are gone... I use a localdir resource too. Hope that this will be fixed in KDE4.
I tried to reproduce this, but when I tried to add an event after deleting 2 I was given an popup error saying 'unable to save'.
@Brian: which version did you used? 3.5? Anyway I cannot reproduce using korganizer in KDE 3.5.10. I've tested current trunk too, which saves correctly events (even if the display is not ever refreshed).
I can still reproduce using KDE 3.5.10. Just add 2 events, e.g. called 1 and 2, then delete 1 and 2. Create a new one called 3. Quit korganizer, start it again -> 3 is not there (It would really make me wonder if the bug is solved in a 3.5.x release, as nobody is working on this anymore ...)
This bug was fixed in trunk 3 days ago - commit 926668