Bug 351652 - Some contacts from CardDAV Ressource do not appear in kaddressbook
Summary: Some contacts from CardDAV Ressource do not appear in kaddressbook
Status: RESOLVED FIXED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: DAV Resource (show other bugs)
Version: 1.13.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-23 16:11 UTC by Ben
Modified: 2015-08-31 20:35 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 15.08.1


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ben 2015-08-23 16:11:56 UTC
I have configured an ownCloud 8.1 instance as DAV groupware ressource for calendar and contacts. The address book is listet in the "Address Books" area and SOME contacts appear in the listing of KAddressBook. But many other contacts in the resource, which are visible in the ownCloud web interface and other DAV clients such as my android phone or Thunderbird via SoGo Connector, don't appear in KAddressBook or KMail's auto-complete for addressfields during mail composition.

I also have checked "Akonadi Console". The contacts showing up are also listed in the appropriate collection in the "Browser" Tab. Many more contact vcf file items do show up in the "DB Browser" "PimItemTable"

I suspect it has to do with the filename the DAV server reports. When I call the carddav url directly in dolphin through the webdavs:// io handler I see all contacts of the adrressbook but with different file name formats:

The vcf contacts that are working look like:

Filename: 76ac28be-4f00-49c2-91dd-0e5d11716fe0.vcf

Content:
BEGIN:VCARD
VERSION:3.0
EMAIL:some@email.com
FN:Some Name
N:Name;Some;;;
PRODID:-//ownCloud//NONSGML Contacts 0.3.0.18//EN
REV:2015-08-23T14:37:49+00:00
TEL;TYPE=CELL:+1234567
UID:76ac28be-4f00-49c2-91dd-0e5d11716fe0
END:VCARD

Those that do not show up:
Filename: 20140721T192733.4cc4ba55ef%40url.of.my.server.vcf

Content:
BEGIN:VCARD
VERSION:3.0
FN:Some Name
N:Name;Some;;;
EMAIL;TYPE=INTERNET:foo@bar.com
TEL;TYPE=HOME:+1234553
UID:20140721T192733.4cc4ba55ef@url.of.my.server.de
REV:2015-08-23T14:33:49+00:00
PRODID:-//ownCloud//NONSGML Contacts 0.3//EN
END:VCARD


Note the escaped @ sign as %40 on the not working card. At least that's how they show up in Dolphin.

Reproducible: Always

Steps to Reproduce:
1. Set up CardDAV ressource on ownCloud server
2. Add contact A directly in web interface
3. Add contact B from KAddressBook


Actual Results:  
B shows up in KAddressBook, A does not

Expected Results:  
Both contacts should be visible
Comment 1 Ben 2015-08-23 16:36:44 UTC
And before you ask:
I have seen https://bugs.kde.org/show_bug.cgi?id=350748 and the patch from https://github.com/owncloud/contacts/pull/987 as referenced in ownCloud issue 1004 https://github.com/owncloud/contacts/issues/1004 did not resolve this bug.
Comment 2 Grégory Oestreicher 2015-08-29 12:35:08 UTC
Yup, confirmed indeed.
Comment 3 Grégory Oestreicher 2015-08-29 20:22:07 UTC
*** Bug 351682 has been marked as a duplicate of this bug. ***
Comment 4 Grégory Oestreicher 2015-08-29 20:22:28 UTC
*** Bug 351824 has been marked as a duplicate of this bug. ***
Comment 5 Grégory Oestreicher 2015-08-29 23:05:26 UTC
Oops, it looks like I've been to quick merging those bugs. For this one (the UID of the contact containing a '@') the problem seems to come from ownCloud. The raw response replaces '@' with '%2540' so it's clearly double encoded.

Here's a partial dump of an addressbook-query REPORT if that can help the OC devs fixing the problem:

 <d:response xmlns:d="DAV:">
  <d:href xmlns:d="DAV:">/remote.php/carddav/addressbooks/greg/contacts/20140721T192733.4cc4ba55ef%2540url.of.my.server.de.vcf</d:href>
  <d:propstat xmlns:d="DAV:">
   <d:prop xmlns:d="DAV:">
    <d:resourcetype xmlns:d="DAV:"/>
    <d:getetag xmlns:d="DAV:">"bb67513c0c33c91f51e3337e381b9f77"</d:getetag>
   </d:prop>
   <d:status xmlns:d="DAV:">HTTP/1.1 200 OK</d:status>
  </d:propstat>
  <d:propstat xmlns:d="DAV:">
   <d:prop xmlns:d="DAV:">
    <d:displayname xmlns:d="DAV:"/>
   </d:prop>
   <d:status xmlns:d="DAV:">HTTP/1.1 404 Not Found</d:status>
  </d:propstat>
 </d:response>
Comment 6 Ben 2015-08-30 19:22:09 UTC
Found a bug that fits: https://github.com/owncloud/contacts/issues/998
Comment 7 Ben 2015-08-31 15:33:36 UTC
ownCloud Contacts thinks that this is not a bug in ownCloud but in KDE (and Windows Phone) https://github.com/owncloud/contacts/issues/998#issuecomment-136251580

Is there another reason, why your PROPFIND yields a 404 but gvds's PROPFIND works fine?
Comment 8 Grégory Oestreicher 2015-08-31 19:44:47 UTC
The 404 in the PROPFIND is simply here for the 'displayname' property.

Looks like I'll reopen this, pending more investigation.
Comment 9 Grégory Oestreicher 2015-08-31 20:22:46 UTC
So the resource has a fix pending (well, I stupidly developed it against master and not 15.08 so I have to backport it), but ownCloud has an issue still it seems. After the patch has been committed I'm not sure there's much more that can be done on KDE side, it'll be up to the ownCloud devs to fix the remaining problem :)
Comment 10 Grégory Oestreicher 2015-08-31 20:35:34 UTC
Git commit 09282b0489a5f84b6173e99daf24e3dc5540ae78 by Grégory Oestreicher.
Committed on 31/08/2015 at 20:35.
Pushed by goestreicher into branch 'Applications/15.08'.

Don't decode URLs found in responses
FIXED-IN: 15.08.1

M  +8    -3    resources/dav/protocols/caldavprotocol.cpp
M  +8    -3    resources/dav/protocols/carddavprotocol.cpp

http://commits.kde.org/kdepim-runtime/09282b0489a5f84b6173e99daf24e3dc5540ae78