[Owncloud] contacts VCV REV field update problem

Thomas Tanghus thomas at tanghus.net
Fri May 10 21:11:03 UTC 2013


Hi Ismael

On Friday 03 May 2013 16:04 Ismail YENIGUL wrote:
> Thanks for your feedback.
> I talked with my developers. They are deleting and re-adding the contacts :)

:)

> But they say that there is no edit method in the webdav client called
> WebDAV .NET
> by the way we also delete and re-add the caldav events, owncloud use our
> LAST-MODIFIED value in the .ics file
> Then we thought that something is wrong with carddav?
> My question is what is the proper way to handle update caldav/carddav?

I don't know much about the protocol - we rely on SabreDAV [1] and only 
implement the backend for storing/retrieving objects. I would say a simple 
HTTP PUT is the proper way to update, but you would have to consult the WebDAV 
spec [2] and the RFC [3]

/Thomas

[1] http://code.google.com/p/sabredav/
[2] http://www.webdav.org/specs/
[3] https://tools.ietf.org/html/rfc4918
 
> On 3.5.2013 15:41, Thomas Tanghus wrote:
> > Hi Ismail
> > 
> > When adding new contacts their properties may get updated because we store
> > them internally as vCard 3.0, and because we then can't guarantee that the
> > contact is identical after adding, the REV property is updated.
> > The method you mention is *only* called when adding contacts, so my guess
> > is it's rather in the edit() method [1] it gets updated. I hope you're
> > not syncing by deleting and re-adding the vCards? ;)
> > 
> > It's a valid issue, and I will see to change it so that if contacts are
> > updated via CardDAV the REV will only be updated/added if it doesn't
> > exist.
> > 
> > BTW, wouldn't it be a more reliable method to check for the Etag being
> > send? It is my understanding that most *DAV sync clients use that.
> > 
> > [1]
> > https://github.com/owncloud/apps/blob/stable5/contacts/lib/vcard.php#L513> 
> > On Friday 03 May 2013 12:13 Ismail YENIGUL wrote:
> >> We developed a outlook contacts and calendar sync from a caldav/carddav
> >> server.
> >> We are making tests on owncloud. There is no problem with  calendar part.
> >> But we have a problem about update date of the contacts. We create a vcf
> >> file on the client side that contains REV field like the following
> >> 
> >> PRODID:-//ownCloud//NONSGML Contacts 0.2.5//EN
> >> *REV:2013-04-29T13:40:53+00:00*
> >> FN:Yusuf Cemal
> >> N:Cemal;Yusuf;;
> >> ...
> >> 
> >> When we upload this file to owncloud via DAV. Owncloud does not take
> >> care of this field and inserts own "last change date" to the database.
> >> This causes continues update for the same contacts on the outlook side.
> >> Is there any way to disable auto update of last change on the owncloud
> >> side  if the REV is defined in VCF file.
> >> 
> >> It seems that the problem is at the following lines:
> >> # vi apps/contacts/lib/vcard.php
> >> 
> >>    /**
> >>    
> >>           * @brief Tries to update imported VCards to adhere to rfc2426
> >> 
> >> (VERSION: 3.0) and add mandatory fields if missing.
> >> 
> >>           * @param aid Address book id.
> >>           * @param vcard A Sabre\VObject\Component of type VCARD (passed
> >> 
> >> by reference).
> >> 
> >>           */
> >>           protected static function *updateValuesFromAdd*($aid, &$vcard)
> >> 
> >> { // any suggestions for a better method name? ;-)
> >> 
> >>    }
> >>    
> >>                   if(self::trueUID($aid, $uid)) {
> >>                   
> >>                           $vcard->{'UID'} = $uid;
> >>                   
> >>                   }
> >> 
> >> *$now = new \DateTime;**
> >> **                $vcard->{'REV'} = $now->format(\DateTime::W3C);*
> >> 
> >>           }
> >> 
> >> Thanks
-- 
Med venlig hilsen / Best Regards

Thomas Tanghus



More information about the Owncloud mailing list