1

I'm integrating the Google CardDAV with my webApplication. I have a strange problem sometimes when I make a PUT of a new vCard.
If the vCard contains a UID and the UID is a GUID Google changes the vCard UID with a 16-char UID.

for example: This is my original vCard

BEGIN:VCARD
VERSION:3.0
N:Pinch;David;;;
FN:David Pinch
REV:2013-01-09T09:26:34Z
UID:6c34bedcf256408780d8ffe269ec2b3b
END:VCARD

So I PUT this into Google CardDAV, into the current url:

https://www.google.com/m8/carddav/principals/__uids__/myusername@gmail.com/lists/default/6c34bedcf256408780d8ffe269ec2b3b

The result is ok, and the contact is really created on Google Contacts.
BUT:
if "now" I retrieve the current vCard from the same URL i have the following response.

BEGIN:VCARD
VERSION:3.0
N:Pinch;David;;;
FN:David Pinch
REV:2013-01-09T09:44:25Z
UID:716212e795884e43
END:VCARD

You can see that UID has changed and passed from original

UID:6c34bedcf256408780d8ffe269ec2b3b

To

UID:716212e795884e43

Curiously if I retrieve the card with the following Request

https://www.google.com/m8/carddav/principals/__uids__/myusername@gmail.com/lists/default/716212e795884e43

I have Exactly the same Response, like the vCard references two different Path url.

However when i retrieve the list of the contact from CardDAV, this return the second URL.
If I does not create the vCard with a GUID but with a 16-char UID, Seems that Google accept this, but sometimes it changes However, so I cannot be sure of the uniqueness of the Card.
A workaround seem to be of re-download the vCard after every PUT, but this causes a payload important that I wanted to avoid.

I use the same procecures with iCloud CardDAV and this doesn't happen.
Anyone can help me?

Tom Harrington
  • 69,312
  • 10
  • 146
  • 170

1 Answers1

0

When you PUT a vCard to Google CardDAV it will recreate a new vCard V3.0 and dispose the original data posted including data loss and the UID / URI path changes you describe.

Other then UID change Google CardDAV has other issues

My advise after still seeing these failures in 2018: its better to use Google's Contacts API instead of there CardDAV implementation.

dehart
  • 1,554
  • 15
  • 18
  • 1
    Links to external resources are encouraged, but please add context around the link so your fellow users will have some idea what it is and why it’s there. Always quote the most relevant part of an important link, in case the target site is unreachable or goes permanently offline. – baduker Mar 26 '18 at 18:32