Bug 327623 - Contact is not sync to DAV (owncloud) when I import VCF-file
Summary: Contact is not sync to DAV (owncloud) when I import VCF-file
Status: RESOLVED FIXED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: DAV Resource (show other bugs)
Version: 4.12
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-14 19:22 UTC by Eugen Albiker
Modified: 2014-08-31 21:42 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.14.1


Attachments
testvcard.vcf (344 bytes, text/vcard)
2013-11-14 19:22 UTC, Eugen Albiker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eugen Albiker 2013-11-14 19:22:03 UTC
Hi,
I am using:
ii 4:4.11.3-0ubuntu0.1~ubuntu13.10~ppa amd64

I export a Google-contact from kaddressbook and get the file "testvcard.vcf" 
When I import this VCF into a DAV-Recource (owncloud) the Contact is never synced to Owncloud. 
But if i delete the UID line from the "testcard.vcf" and import the contact to the DAV-Resource, then the contact will be synchronised!! --> Correct 

This only happens if I import the contact into the DAV-Resource in kadressbook. 

More: If I Import the contact in owncloud ("with" OR "without" the UID), then the contact is synced to kadressbook, and I can edit it in kadressbook and it will be synced back to the owncloud-DAV-Recource. 

Need any more Info, then I will try to help.
Greetings Eugen

Reproducible: Always

Steps to Reproduce:
1. Import the "testvcard.vcf" in Kadressbook

Actual Results:  
Log into the webclient of "owncloud" and go to Contacts. The Contact will never be there

Expected Results:  
Log into the webclient of "owncloud" and go to Contacts. The Contact will show up (and will be synced from Kadressbook)

Content of the test-File "testvcard.vcf" - and yes: the Linefeed and " \" (Space+Backslash) in the filed "UID" is correct. This is exported from kadressbook out of a google-contact-resource.

BEGIN:VCARD
FN:Mustermann Jasmin
N:Mustermann;Jasmin;;;
NAME:Mustermann\\\, Jasmin
TEL;TYPE=CELL:01787203722
UID:http://www.google.com/m8/feeds/contacts/tanarri75%40googlemail.com/base
 /4105ff60d891cad
VERSION:3.0
X-GCALENDAR-GROUPMEMBERSHIPINFO:http://www.google.com/m8/feeds/groups/tanar
 ri75%40googlemail.com/base/6
END:VCARD
Comment 1 Eugen Albiker 2013-11-14 19:22:38 UTC
Created attachment 83566 [details]
testvcard.vcf
Comment 2 Martin Koller 2014-03-20 19:23:18 UTC
Can reproduce with KDE 4.12.90 (4.13 beta)
Comment 3 Martin Koller 2014-03-20 21:08:36 UTC
Seems to be a problem of owncloud.
I created a bug report there https://github.com/owncloud/contacts/issues/450
Comment 4 Thomas Tanghus 2014-04-18 02:28:52 UTC
(In reply to comment #3)
> Seems to be a problem of owncloud.
> I created a bug report there https://github.com/owncloud/contacts/issues/450

This is because of the Akonadi resource not normalizing the URI. It sends a request like:

PUT /remote.php/carddav/addressbooks/tanghus/contacts/http://www.google.com/m8/feeds/contacts/XXXXX@googlemail.com/base/4105ff60d891cad.vcf

Which will of course fail because of the extra slashes in the principal URI.
Comment 5 Thomas Tanghus 2014-04-18 02:45:54 UTC
But why Google couldn't just use a simple, unique identifier as adviced in the RFC is beyond my comprehension skills... https://tools.ietf.org/html/rfc2426#section-3.6.7

They're almost as bad as Apple in wanting to do it "My way or the highway"
Comment 6 Grégory Oestreicher 2014-08-31 21:42:56 UTC
Git commit 509c99171995c78b7aae39ef73cf9d4209d704fd by Grégory Oestreicher.
Committed on 31/08/2014 at 21:41.
Pushed by goestreicher into branch 'KDE/4.14'.

Generate a unique ID for file names

Based on a review submitted by Dan Vratil.
FIXED-IN: 4.14.1

M  +11   -12   resources/dav/common/davutils.cpp
M  +5    -0    resources/dav/common/davutils.h

http://commits.kde.org/kdepim-runtime/509c99171995c78b7aae39ef73cf9d4209d704fd