Bug 313670

Summary: DAV Akonadi resource falsely changes the mimetype of the todos to events
Product: Akonadi Reporter: Matija Šuklje <matija>
Component: DAV ResourceAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 4.9   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In: 4.10.2
Attachments: Don't set the mime type if the protocol supports multiget
Akonadi Debug info after applying the patch

Description Matija Šuklje 2013-01-22 09:17:01 UTC
Akonadi’s DAV resource at some point in time — usually after a few days, but it never fails me — changes the mimetypes of all items in the resource to application/x-vnd.akonadi.calendar.event, regardless whether it’s raw output is VTODO or VEVENT.

This happens regardless of whether a certain calendar in the resource includes only VTODO, only VEVENT or both.

If I add new todo’s, until the next recurrence their mimetype stays as application/x-vnd.akonadi.calendar.todo.

This is quite annoying for me because Zanshin only shows application/x-vnd.akonadi.calendar.todo and not .event — meaning that I’m left with empty todo lists. As KOrganizer and EventList do not do such filtering, they show todos as well.

Reproducible: Always

Steps to Reproduce:
1. Create a calendar with that includes VTODO’s on a CalDAV resource;
2. Add the CalDAL resource to Akonadi;
3. Wait for a few days;
4. Check Zanshin and/or Akonadi Console.
Actual Results:  
- in Zanshin you see empty calendars;
- in Akonadi Console’s browser you can see that all the items were changed to application/x-vnd.akonadi.calendar.event regardless whether their raw output says it’s VTODO or VEVENT;
- in KOrganizer and EventList plasmoid you see VTODO’s as well.

Expected Results:  
- *keep* the mimetypes correctly — i.e. .event for VEVENT and .todo for VTODO

Workaround:
- in Akonadi Console remove DAV resource
- in Akonadi Console re-add the same DAV resource
(works also by simply cloning it)

Because a freshly (re)added resource fixes it, I’m suspecting it’s Akonadi that messes things up.

Local iCal files and Kolab work just, fine, so I suspect it’s only the Akonadi DAV resource. I heard that this used to happened also with the Google resource, if it’s maybe related.

Versions:
KDE 4.9.3
Zanshin 0.2.1
Akonadi backend: MySQL
ownCloud: 4.5.5 (same issue with older versions), uses SabreDAV 1.6.4
Baïkal: 0.2.4, uses SabreDAV 1.8.0
Comment 1 Grégory Oestreicher 2013-01-25 18:00:04 UTC
Created attachment 76718 [details]
Don't set the mime type if the protocol supports multiget

Here is a patch for you to test and see if that helps.
Comment 2 Matija Šuklje 2013-01-26 09:26:53 UTC
(In reply to comment #1)
> Here is a patch for you to test and see if that helps.

I tried that patch against 4.9.3 and the results are funny:

- ownCloud 4.5.5 (SabreDAV 1.6.4) lists only calendars and addressbooks, but *no*  items in them — they’re completely empty even in Akonadi Console
- Baïkal 0.2.4 (SabreDAV 1.8.0) so far seems to work just fine.

Will try to upgrade ownCloud to 4.5.6 (SabreDAV 1.6.6) and see if that helps.
Comment 3 Matija Šuklje 2013-01-26 10:09:12 UTC
(In reply to comment #2)
> - ownCloud 4.5.5 (SabreDAV 1.6.4) lists only calendars and addressbooks, but
> *no*  items in them — they’re completely empty even in Akonadi Console
[…]
> Will try to upgrade ownCloud to 4.5.6 (SabreDAV 1.6.6) and see if that helps.

The same is true for ownCloud 4.5.6
Comment 4 Matija Šuklje 2013-01-26 10:11:51 UTC
Created attachment 76731 [details]
Akonadi Debug info after applying the patch

- patch applied to KDEPIM 4.9.3
- tested on ownCloud 4.5.6 (SabreDAV 1.6.6)
Comment 5 Matija Šuklje 2013-02-14 17:41:04 UTC
I can replicate it in (unpatched) 4.9.5 as well.

I noticed that it seems to trigger when mysql, virtuoso-t and/or akonadiserver are eating up large amounts of CPU for a long time.
Comment 6 Matija Šuklje 2013-02-16 02:59:48 UTC
Applying Grégory’s patch on 4.9.5 I get the same results as with 4.9.3 in Comment #2.  

BTW, last time I noted down when I set it up and when it stopped working.

I set it up on the 2012-02-04 around 13:00 and on 2012-02-11 at around 12:30 the bug replicated.
Comment 7 Grégory Oestreicher 2013-03-26 18:23:58 UTC
Git commit 3eb827f7e6d17161bb5b1558bc066d4bcb134ce3 by Grégory Oestreicher.
Committed on 25/03/2013 at 22:03.
Pushed by goestreicher into branch 'KDE/4.10'.

Prevent duplicates in mCollectionsWithTemporaryError
Related: bug 314206
FIXED-IN: 4.10.2

M  +4    -1    resources/dav/resource/davgroupwareresource.cpp

http://commits.kde.org/kdepim-runtime/3eb827f7e6d17161bb5b1558bc066d4bcb134ce3