[Owncloud] contacts VCV REV field update problem

Thomas Tanghus thomas at tanghus.net
Fri May 3 12:41:13 UTC 2013


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