Hello,
In 44b8edd4f2223bf96cfd9ef891f40a37fb489ed9, setting REV from JavaScript was introduced like this:
```
contact.rev(new Date().toISOString());
````
The format generated by new Date().toISOString() is 2016-11-27T16:53:30.027Z, which currently causes problems with VCard libraries like ez-vcard (https://github.com/mangstadt/ez-vcard/issues/73). While the format seems to be correct according to ISO.8601.2004, it would reduce problems with CardDAV clients like DAVdroid if the timestamp could be printed in an easier format, like REV:19951031T222710Z (without milliseconds).
Also, VALUE=timestamp is redundant and could be removed.
Would that be possible? Currently, this change (released with nextcloud/contacts 1.5.2) breaks DAVdroid synchronization (more information here).
Will look into this, thank you for reporting!
Hi,
i'm sorry, same error message again:
SYNCHRONIZATION INFO
Synchronization phase: 4
Account name: post@***.de
Authority: com.android.contacts
HTTP REQUEST:
PUT /remote.php/dav/addressbooks/users/conny/kontakte1/2e4f2d8d8a.vcf
If-Match: "d37068c3c4463c735d23d79133b899b7"
BEGIN:VCARD[CR][LF]
VERSION:4.0[CR][LF]
PRODID:+//IDN bitfire.at//DAVdroid/1.3.4.1-ose vcard4android ez-vcard/0.10.[CR][LF]
0[CR][LF]
REV;VALUE=timestamp:2016-11-19T17:44:22.057Z[CR][LF]
UID:2e4f2d8d8a[CR][LF]
FN:Name Name[CR][LF]
N:Name;Name;;;[CR][LF]
TEL;TYPE=voice:+49123456[CR][LF]
TEL;TYPE=fax:+49123456[CR][LF]
TEL;TYPE=voice:+49123456[CR][LF]
REV:20161130T181514Z[CR][LF]
END:VCARD[CR][LF]
HTTP RESPONSE:
http/1.1 415 Unsupported Media Type
Cache-Control: no-store, no-cache, must-revalidate
Connection: keep-alive
Content-Security-Policy: default-src 'none';
Content-Type: application/xml; charset=utf-8
Date: Wed, 30 Nov 2016 18:15:15 GMT
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Pragma: no-cache
Server: nginx/1.10.0 (Ubuntu)
Set-Cookie: nc_username=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; secure; HttpOnly
Set-Cookie: nc_token=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; secure; HttpOnly
Set-Cookie: nc_session_id=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; secure; HttpOnly
Set-Cookie: nc_username=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/; secure; HttpOnly
Set-Cookie: nc_token=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/; secure; HttpOnly
Set-Cookie: nc_session_id=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/; secure; HttpOnly
Set-Cookie: oc25c89f73a9=jpe5euuidguh7eii42b65if3n4; path=/; secure; HttpOnly
Transfer-Encoding: chunked
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: Sameorigin
X-Permitted-Cross-Domain-Policies: none
X-Robots-Tag: none
X-XSS-Protection: 1; mode=block
<?xml version="1.0" encoding="utf-8"?>[LF]
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">[LF]
<s:exception>Sabre\DAV\Exception\UnsupportedMediaType</s:exception>[LF]
<s:message>Validation error in vCard: REV MUST NOT appear more than once in a VCARD component</s:message>[LF]
</d:error>[LF]
EXCEPTION:
at.bitfire.dav4android.exception.HttpException: 415 Unsupported Media Type
at at.bitfire.dav4android.DavResource.checkStatus(DavResource.java:318)
at at.bitfire.dav4android.DavResource.checkStatus(DavResource.java:291)
at at.bitfire.dav4android.DavResource.put(DavResource.java:202)
at at.bitfire.davdroid.syncadapter.SyncManager.uploadDirty(SyncManager.java:317)
at at.bitfire.davdroid.syncadapter.SyncManager.performSync(SyncManager.java:147)
at at.bitfire.davdroid.syncadapter.ContactsSyncAdapterService$ContactsSyncAdapter.onPerformSync(ContactsSyncAdapterService.java:66)
at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:254)
SOFTWARE INFORMATION
DAVdroid version: 1.3.4.1-ose (128) Wed Nov 16 10:26:01 MEZ 2016
Installed from: APK (directly)
JB Workaround installed: no
I'm on Nextcloud 11 beta 1 and contact module in the following state:
www-data@vmd6599 ~/o/a/contacts> git status
HEAD detached at origin/fix-rev
nothing to commit, working directory clean
www-data@vmd6599 ~/o/a/contacts>
Best Regards,
Cornelius
HTTP REQUEST: PUT /remote.php/dav/addressbooks/users/conny/kontakte1/2e4f2d8d8a.vcf If-Match: "d37068c3c4463c735d23d79133b899b7" BEGIN:VCARD[CR][LF] VERSION:4.0[CR][LF] PRODID:+//IDN bitfire.at//DAVdroid/1.3.4.1-ose vcard4android ez-vcard/0.10.[CR][LF] 0[CR][LF] REV;VALUE=timestamp:2016-11-19T17:44:22.057Z[CR][LF] UID:2e4f2d8d8a[CR][LF] FN:Name Name[CR][LF] N:Name;Name;;;[CR][LF] TEL;TYPE=voice:+49123456[CR][LF] TEL;TYPE=fax:+49123456[CR][LF] TEL;TYPE=voice:+49123456[CR][LF] REV:20161130T181514Z[CR][LF] END:VCARD[CR][LF]
hmm .. the question to me is: why is davdroid sending REV twice?
Just to be clear: the linked pull request will "only" fix the timestamp as generated in the owncloud contacts app.
I suspect deleting the "wrong" REV timestamp in the VCard will get rid of the problem, since already two REV fields are present - meaning new VCards probably won't have this problem.
@DeepDiver1975 I sometimes saw issues with my/the previous way of adding/changing the REV field, leading to two REV properties being present in the VCard.
I sometimes saw issues with my/the previous way of adding/changing the REV field, leading to two REV properties being present in the VCard.
Contacts app is not generating the duplicate REV tag - at least as tested with the linked PR
@DeepDiver1975 Thanks, that should fix the problem.
@DeepDiver1975 Is there a released version of the Nextcloud Contacts app where this issue is fixed? Seems like 1.5.2 is still the current one, and more and more people complain about this.
Ok, it's still not fixed. ez-vcard doesn't recognize the timestamp without "Z" at the end. Let's start from the beginning …
(Can you please reopen this?)
Which is the last known working version? Is it possible to downgrade to that (core=NC 11)?
Is there a released version of the Nextcloud Contacts app where this issue is fixed?
This is up to the nextcloud contacts app maintainers .... I'm not involved in the roadmap here
BTW, what is the time zone of the current REV value? Wouldn't it be more clear to use the 'Z' format and UTC? If the time is floating local time, two different revisions could have the same REV (create a VCard, save it, then move to a location with one hour time difference, wait an hour, save it again and it will have the same REV).
@rfc2822 I think you're right, we need to use the Z format. For clarification, the vcard rfc docs all use a 'Z' format as example https://tools.ietf.org/html/rfc6350#section-6.7.4
After nextcloud 11 upgrade I have the same / similar issue.
Contacts have two REV fields.
In one contact I have:
REV;VALUE=timestamp:2016-10-10T06:14:06.506Z[CR][LF]
and:
REV;20161223T073554Z[CR][LF]
Dump is from DAVDroid error log.
Hi, thanks for your help @SomeStrangeName! :)
What is the exact error from davdroid?
I installed the latest git-version of contacts, readded the nextcloud account on davdroid and now everything works fine!
Fixed in #65
DAVdroid 1.3.6 now uses ez-vcard/0.10.1 and understands milliseconds and timestamps without Z/time zone offset. To solve DAVdroid problems with duplicate REV values: https://forums.bitfire.at/post/7637
@skjnldsv, sorry I deleted the corrupt contact and that fixed my issue here. I can't provide the full log.
I also detected a contact with some corrupt string in a "note" property of the vcard. After deleting this another issue was fixed.
Most helpful comment
After nextcloud 11 upgrade I have the same / similar issue.
Contacts have two REV fields.
In one contact I have:
REV;VALUE=timestamp:2016-10-10T06:14:06.506Z[CR][LF]and:
REV;20161223T073554Z[CR][LF]Dump is from DAVDroid error log.