Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad date for contact's Birthday after Davdroid sync #466

Closed
pulcov opened this issue Jul 25, 2016 · 11 comments
Closed

Bad date for contact's Birthday after Davdroid sync #466

pulcov opened this issue Jul 25, 2016 · 11 comments
Labels
Milestone

Comments

@pulcov
Copy link

pulcov commented Jul 25, 2016

Steps to reproduce

  1. Create or modify birthday's contact on android phone
  2. Synchronize contact with davdroid
  3. Go to contact apps

Expected behaviour

Contact birthday have formatted date

Actual behaviour

Date is not formatted
Here, date is 2016-07-22 but visible date is 20160722:
contact

Server configuration

Operating system:
Debian Jessie 8

Web server:
Apache 2.4.10

Database:
MySQL

PHP version:
PHP 5.6.23

ownCloud version: (see ownCloud admin page)
9.1

Updated from an older ownCloud or fresh install:
Updated from an older ownCloud

Where did you install ownCloud from:
Debian rep

Signing status (ownCloud 9.0 and above):
integrity check is disabled

Client configuration

Browser:
Davdroid 1.2

Operating system:
Android 5.1

DavDroid Log:

2016-07-25 11:03:05 1 [syncadapter.SyncManager] Checking sync state
2016-07-25 11:03:05 1 [syncadapter.SyncManager] Manual sync, ignoring CTag
2016-07-25 11:03:05 1 [syncadapter.SyncManager] Listing local entries
2016-07-25 11:03:05 2 [HttpClient$1] 
2016-07-25 11:03:05 2 [HttpClient$1] <?xml version="1.0"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:card="urn:ietf:params:xml:ns:carddav">
 <d:response>
  <d:href>/remote.php/carddav/addressbooks/vince/contacts/</d:href>
  <d:propstat>
   <d:prop>
    <card:supported-address-data>
     <card:address-data-type content-type="text/vcard" version="3.0"/>
     <card:address-data-type content-type="text/vcard" version="4.0"/>
     <card:address-data-type content-type="application/vcard+json" version="4.0"/>
    </card:supported-address-data>
    <x1:getctag xmlns:x1="http://calendarserver.org/ns/">145</x1:getctag>
   </d:prop>
   <d:status>HTTP/1.1 200 OK</d:status>
  </d:propstat>
 </d:response>
</d:multistatus>

2016-07-25 11:03:05 2 [HttpClient$1] <-- END HTTP (708-byte body)
2016-07-25 11:03:06 2 [dav4android.DavResource] Received <response> for https://********/remote.php/carddav/addressbooks/vince/contacts/
    PARAMETER #1 = [supported-address-data(urn:ietf:params:xml:ns:carddav): at.bitfire.dav4android.property.SupportedAddressData@b3128, getctag(http://calendarserver.org/ns/): GetCTag(cTag=145)]
2016-07-25 11:03:06 2 [syncadapter.ContactsSyncManager] Server advertises VCard/4 support: true
2016-07-25 11:03:06 2 [syncadapter.ContactsSyncManager] Contact group method: CATEGORIES
2016-07-25 11:03:06 2 [syncadapter.SyncManager] Processing locally deleted entries
2016-07-25 11:03:06 2 [syncadapter.SyncManager] Locally preparing dirty entries
2016-07-25 11:03:06 2 [syncadapter.SyncManager] Looking for contacts/groups without file name
2016-07-25 11:03:06 1 [syncadapter.SyncManager] Found local resource: contacts-1fb6786c-578d-4163-91db-cd6b9dddf13b.vcf.ics
2016-07-25 11:03:06 1 [syncadapter.SyncManager] Found local resource: contacts-90c1113f-a77f-4d1f-ae21-89faeb02576d.vcf.ics
2016-07-25 11:03:06 1 [syncadapter.SyncManager] Found local resource: contacts-4357c89e-e679-412d-9336-af0d8a565d1c.vcf.ics
2016-07-25 11:03:06 1 [syncadapter.SyncManager] Found local resource: contacts-667f2452-6460-44da-b11d-b5053738827f.vcf.ics
2016-07-25 11:03:06 1 [syncadapter.SyncManager] Found local resource: contacts-8f8765a5-548a-4ea0-a123-1b857ab5bed0.vcf.ics
2016-07-25 11:03:06 1 [syncadapter.SyncManager] Found local resource: contacts-956bba10-f293-4661-83d1-e2385eb288d2.vcf.ics
2016-07-25 11:03:06 1 [syncadapter.SyncManager] Found local resource: contacts-15248827-1434-4e2c-b43f-fd79c99f410e.vcf.ics
2016-07-25 11:03:06 1 [syncadapter.SyncManager] Found local resource: contacts-142f1090-ec63-4aa8-92c4-8ced3c04682a.vcf.ics
2016-07-25 11:03:06 2 [syncadapter.SyncManager] Found local record #628 without file name; assigning file name/UID based on c93ba3a1-20f7-4541-bc28-daaf4cad49bb
2016-07-25 11:03:06 1 [syncadapter.SyncManager] Found local resource: contacts-30061b47-159f-462d-803d-6d308f540424.vcf.ics
2016-07-25 11:03:06 1 [syncadapter.SyncManager] Found local resource: contacts-428ea086-6754-4361-bd4c-8585e2a3e7a6.vcf.ics
2016-07-25 11:03:06 1 [syncadapter.SyncManager] Found local resource: contacts-11ac3af2-7dde-4e62-a181-2f880be3c115.vcf.ics
2016-07-25 11:03:06 1 [syncadapter.SyncManager] Found local resource: contacts-94d47ced-b800-451b-b986-522777c36d68.vcf.ics
2016-07-25 11:03:06 1 [syncadapter.SyncManager] Listing remote entries
2016-07-25 11:03:06 1 [HttpClient$1] --> REPORT https://********/remote.php/caldav/calendars/vince/contact_birthdays/ http/1.1
2016-07-25 11:03:06 1 [HttpClient$1] Content-Type: application/xml; charset=utf-8
2016-07-25 11:03:06 1 [HttpClient$1] Content-Length: 328
2016-07-25 11:03:06 1 [HttpClient$1] Depth: 1
2016-07-25 11:03:06 1 [HttpClient$1] 
2016-07-25 11:03:06 1 [HttpClient$1] <?xml version='1.0' encoding='UTF-8' ?><CAL:calendar-query xmlns="DAV:" xmlns:CAL="urn:ietf:params:xml:ns:caldav"><prop><getetag /></prop><CAL:filter><CAL:comp-filter name="VCALENDAR"><CAL:comp-filter name="VEVENT"><CAL:time-range start="20160426T110306Z" /></CAL:comp-filter></CAL:comp-filter></CAL:filter></CAL:calendar-query>
2016-07-25 11:03:06 1 [HttpClient$1] --> END REPORT (328-byte body)
2016-07-25 11:03:06 1 [HttpClient$PreemptiveAuthenticationInterceptor] Adding basic authorization header for user vince
2016-07-25 11:03:06 2 [syncadapter.SyncManager] Uploading dirty entries
2016-07-25 11:03:06 2 [syncadapter.ContactsSyncManager] Preparing upload of VCard c93ba3a1-20f7-4541-bc28-daaf4cad49bb.vcf
    PARAMETER #1 = Contact(uid=c93ba3a1-20f7-4541-bc28-daaf4cad49bb, displayName=AAA, givenName=AAA, familyName=null)
2016-07-25 11:03:06 2 [syncadapter.SyncManager] Uploading new record c93ba3a1-20f7-4541-bc28-daaf4cad49bb.vcf
2016-07-25 11:03:06 2 [HttpClient$1] --> PUT https://********/remote.php/carddav/addressbooks/vince/contacts/c93ba3a1-20f7-4541-bc28-daaf4cad49bb.vcf http/1.1
2016-07-25 11:03:06 2 [HttpClient$1] Content-Type: text/vcard;version=4.0
2016-07-25 11:03:06 2 [HttpClient$1] Content-Length: 205
2016-07-25 11:03:06 2 [HttpClient$1] If-None-Match: *
2016-07-25 11:03:06 2 [HttpClient$1] 
2016-07-25 11:03:06 2 [HttpClient$1] BEGIN:VCARD
VERSION:4.0
PRODID:+//IDN bitfire.at//DAVdroid/1.2 vcard4android ez-vcard/0.9.10
UID:c93ba3a1-20f7-4541-bc28-daaf4cad49bb
FN:AAA
N:;AAA;;;
BDAY:20160725
REV:20160725T090306Z
END:VCARD

2016-07-25 11:03:06 2 [HttpClient$1] --> END PUT (205-byte body)
@Po2le
Copy link

Po2le commented Sep 28, 2016

I noticed the same behaviour plus something else when changing multiple contacts:

  1. Create or modify birthday's contact on android phone 2016-09-28
  2. Synchronize contact with DAVdroid
  3. Go to contact apps 20160928
  4. Change date at contact app to 2016-09-28
  5. Sync again using DAVdroid
  6. Reload the contacts page and you will sometimes see 2016-0928

... maybe some kind of race condition because only the first - survived?

@Po2le
Copy link

Po2le commented Sep 28, 2016

Does not happen with CardDAV-Sync because there is an option to configure the "Internal date format" to yyyy-mm-dd I did not find an option todo so at DAVdroid.

@DeepDiver1975
Copy link
Member

Can I see the vcard from the db after each step?

Someone is writing an invalid date from my understanding - either davdroid or ownc loud contacts

@pulcov
Copy link
Author

pulcov commented Sep 28, 2016

Extract of carddata in oc_card table :

After DAVDROID sync :

BEGIN:VCARD
VERSION:4.0
PRODID:+//IDN bitfire.at//DAVdroid/1.3.1-ose vcard4android ez-vcard/0.9.11
REV;VALUE=timestamp:2016-09-20T13:48:34.585Z
UID:6330a33e-00bc-4102-a136-480e04bf1f3b
FN:AAA
N:;AAA;;;
TEL;TYPE=cell:+33600000000
BDAY:20160929
PHOTO:data:image/jpeg;base64,...
REV:20160928T172059Z
END:VCARD

After web site change :

BEGIN:VCARD
VERSION:3.0
PRODID:-//Sabre//Sabre VObject 3.5.0//EN
REV:2016-09-28T17:28:18.222Z
REV:20160928T172059Z
UID:6330a33e-00bc-4102-a136-480e04bf1f3b
FN:AAA
N:;AAA;;;
TEL;TYPE=cell:+33600000000
BDAY:2016-09-29
PHOTO;ENCODING=b;TYPE=JPEG:...
END:VCARD

@DeepDiver1975
Copy link
Member

Allowed formats for bday: https://tools.ietf.org/html/rfc6350#section-6.2.5

We do it wrong 🙈

@pulcov
Copy link
Author

pulcov commented Sep 28, 2016

nobody is perfect ☺️

@irgendwie
Copy link
Contributor

Also the REV field should only be there once and not twice 😞

@crackytsi
Copy link

crackytsi commented Nov 29, 2016

@DeepDiver1975 I updated from 9.0 to 9.1.2 and added a birthday to an account on my phone. Again the date in Owncloud is wrong. (20161128 instead of 2016-11-28). Are you sure this topic can be closed?

@DeepDiver1975
Copy link
Member

Are you sure this topic can be closed?

yes - we 'only' need to release contacts app 1.5

@crackytsi
Copy link

Whooops, oh sorry : -/

@DeepDiver1975
Copy link
Member

Whooops, oh sorry : -/

no problem!

@DeepDiver1975 DeepDiver1975 modified the milestones: 1.5, 2.0 Nov 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants