nextcloud / contacts

📇 Contacts app for Nextcloud
https://apps.nextcloud.com/apps/contacts
GNU Affero General Public License v3.0
569 stars 173 forks source link

export/import problem with vcard version 2.1 #1679

Closed violoncelloCH closed 4 years ago

violoncelloCH commented 4 years ago

Describe the bug

I have many contacts generated (/modified) with Android and synced with Dav-x-5 which are stored as VCARD Version 2.1. When exporting the whole address book, the dav endpoint is queried and returns a single file with all the VCARDS in it as they are stored in the database (therefore v2.1). Re-importing fails for those contacts (v2.1) because the Nextcloud calendar doesn't support v2.1. It gets interesting however if you download a single contact from Nextcloud calender (web app) (view the contact and click on the download icon at the top right) this same contact suddenly states v3.0. Importing it in that form works in most cases (I guess as long as there is nothing in there that VCARD 3.0 can't handle).

Database carddata in oc_cards (same when exporting the whole address book):
BEGIN:VCARD
VERSION:2.1
FN:Adrian Muster
N:Muster;Adrian;;;
EMAIL;INTERNET=:adrian.muster@example.com
TEL;CELL=:+41000000000
UID:d3a6173a-9980-467d-ba49-1aa712b54893
END:VCARD
webdav network response when opening the contact in the web app:
<?xml version="1.0"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:card="urn:ietf:params:xml:ns:carddav" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns"><d:response><d:href>/remote.php/dav/addressbooks/users/jonas/contacts/d3a6173a-9980-467d-ba49-1aa712b54893.vcf</d:href><d:propstat><d:prop><d:getcontenttype>text/vcard; charset=utf-8</d:getcontenttype><d:getetag>&quot;e0163e198afc41880bb714d0b028a700&quot;</d:getetag><d:resourcetype/><card:address-data>BEGIN:VCARD&#13;
VERSION:2.1&#13;
FN:Adrian Muster&#13;
N:Muster;Adrian;;;&#13;
EMAIL;INTERNET=:adrian.muster@example.com&#13;
TEL;CELL=:+41000000000&#13;
UID:d3a6173a-9980-467d-ba49-1aa712b54893&#13;
END:VCARD</card:address-data></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response></d:multistatus>
when downloading as a single contact from within the web app (icon top right):
BEGIN:VCARD
VERSION:3.0
PRODID:-//Sabre//Sabre VObject 4.1.6//EN
FN:Adrian Muster
N:Muster;Adrian;;;
EMAIL;INTERNET=:adrian.muster@example.com
TEL;CELL=:+41000000000
UID:d3a6173a-9980-467d-ba49-1aa712b54893
END:VCARD

I ran into this when migrating to a freshly set up Nextcloud instance. For me personally I migrated those affected contacs more or less manually in the same run as cleaning up my address book from old contacts I don't need anymore. However it feels bizarre that we can't handle our own exports :/

cc @skjnldsv (as you asked me to create this issue when we talked about this during the community hangout call some weeks ago)

violoncelloCH commented 4 years ago

potentially related: #1663 #1595 #1275 #492 #273

skjnldsv commented 4 years ago

and synced with Dav-x-5 which are stored as VCARD Version 2.1.

As far as I know, they are pushing 3 or 4. Because our carddav refuse simply anything below. So your entry might have been there before we drew the line on old vcard versions? :thinking:

violoncelloCH commented 4 years ago

that's possible, or even most likely the case... since when is this restriction in place?

skjnldsv commented 4 years ago

I have no clue, but at least years I'd say? :thinking: :shrug:

skjnldsv commented 4 years ago

closing in favour of https://github.com/nextcloud/contacts/issues/492