nextcloud / contacts

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

exported vCard phone number with ; or , is re-imported incorrect #1297

Open GRaptor opened 4 years ago

GRaptor commented 4 years ago

When a phone (or fax) number field consits of ; or , (used for pause and wait) it can be exported correct to a .vcf However, to import the same file back to contacts creates a wrong entry.

Example: Fax work: 205246;;,; vCard export: TEL;TYPE="WORK,FAX":205246\;\;\,\; (what is correct according to the RFC)

reimport into contacts produces: Fax work: 205246\;\;\,\;

Looks to me the parsing at import does not work correct

BTW: when synchronising with iOS, same issue happens when synching back from iPhone to NextCloud (this time, it's not an Apple ... feature ;-) ) ......

To Reproduce create a new contacts entry enter a phone number and add ; and/or , to it export to .vcf open the exported .vcf and delete the UID identifier line; save it import it into contacts check the phone field

Expected behavior phone number should show up like entered before

Actual behavior the \ of the .vcf file are not parsed correct

Server configuration

Operating system: RaspBerry Buster

Nextcloud version: NextCloudPi 16.0.5

Contacts version: 3.16

Updated from an older Nextcloud or fresh install: Updated

skjnldsv commented 4 years ago

vCard export: TEL;TYPE="WORK,FAX":205246\;\;\,\; (what is correct according to the RFC)

Hum, can you point me where this is correct according to the rfc? :thinking:

GRaptor commented 4 years ago

Well, I read it here, paragraph 3.4 of RFC 6350:

3.4. Property Value Escaping Some properties may contain one or more values delimited by a COMMA character (U+002C). Therefore, a COMMA character in a value MUST be escaped with a BACKSLASH character (U+005C), even for properties that don’t allow multiple instances (for consistency). Some properties (e.g., N and ADR) comprise multiple fields delimited by a SEMICOLON character (U+003B). Therefore, a SEMICOLON in a field of such a "compound" property MUST be escaped with a BACKSLASH character. SEMICOLON characters in non-compound properties MAY be escaped. On input, an escaped SEMICOLON character is never a field separator. An unescaped SEMICOLON character may be a field separator, depending on the property in which it appears. Furthermore, some fields of compound properties may contain a list of values delimited by a COMMA character. Therefore, a COMMA character in one of a field’s values MUST be escaped with a BACKSLASH character, even for fields that don’t allow multiple values (for consistency). Compound properties allowing multiple instances MUST NOT be encoded in a single content line.

But maybe I miss understood?!

Anyway, I would expect that the imported contact looks 100% the exported contact. But it does not.

Marc

skjnldsv commented 4 years ago

Yes, generally. But that doesn't means you can use them in all properties Semi colon means structured data in vcards. https://tools.ietf.org/html/rfc6350#section-6.4.1

ADR;TYPE=work:;Suite D2-630;2875 Laurier;Quebec;QC;G1V 2M2;Canada basically make sense as this is just separate data (array) https://tools.ietf.org/html/rfc6350#section-6.3.1

The only thing I found on the TEL is allowing the extension number TEL;VALUE=uri;PREF=1;TYPE="voice,home":tel:+1-555-555-5555;ext=5555

skjnldsv commented 4 years ago

Ah sorry, I've been bamboozled by the github formatting of \; in my previous message https://github.com/nextcloud/contacts/issues/1297#issuecomment-538850174

Yours are escaped, so it should be allowed indeed, as plain text!

skjnldsv commented 4 years ago

Can you post your vcard here please? I will also need your browser console log to investigate this issue. Open your console, reload your page and/or do the action leading to this issue and copy/paste the log in this thread.

How to access your browser console (Click to expand) # Chrome - Press either CTRL + SHIFT + J to open the “console” tab of the Developer Tools. - Alternative method: 1. Press either CTRL + SHIFT + I or F12 to open the Developer Tools. 2. Click the “console” tab. # Safari - Press CMD + ALT + I to open the Web Inspector. - See Chrome’s step 2. (Chrome and Safari have pretty much identical dev tools.) # IE9 1. Press F12 to open the developer tools. 2. Click the “console” tab. # Firefox - Press CTRL + SHIFT + K to open the Web console (COMMAND + SHIFT + K on Macs). - or, if Firebug is installed (recommended): 1. Press F12 to open Firebug. 2. Click on the “console” tab. # Opera 1. Press CTRL + SHIFT + I to open Dragonfly. 2. Click on the “console” tab.
GRaptor commented 4 years ago

First, find the .vcf attached: 869A4D62-20BB-4031-9C87-C4DFFD8B48B1.zip

The console log is a bit more tricky. How can I expand all the entries? The one line item won't help you, I guess:

_The following contact needed a correction that failed: duplicate types 
Object { jCal: (3) […], addressbook: {…}, vCard: {…}, conflict: false, dav: {…} }
validate.js:38:14
Locale used de 2 PropertyDateTime.vue:171_

On importing this vCard, I get this log:
_The following contact needed a correction that failed: duplicate types 
Object { jCal: (3) […], addressbook: {…}, vCard: {…}, conflict: false, dav: {…} }
validate.js:38:14
Locale used de 2 PropertyDateTime.vue:171
TypeError: "this.$slots.default is undefined"
    initActions ncvuecomponents.js:154
    beforeMount ncvuecomponents.js:154
    VueJS 53
vue.runtime.esm.js:1888:12
The escapeHTML library is deprecated! It will be removed in nextcloud 19. globals.js:30:10
TypeError: "t is undefined"
    u ncvuecomponents.js:154
    beforeUpdate ncvuecomponents.js:154
    VueJS 6
vue.runtime.esm.js:1888:12
This contact did not have a proper uid. Setting a new one for  
Object { jCal: (3) […], addressbook: {…}, vCard: {…}, conflict: false }
contact.js:107:11
TypeError: "t is undefined"
    u ncvuecomponents.js:154
    beforeUpdate ncvuecomponents.js:154
    VueJS 6
vue.runtime.esm.js:1888:12
The escapeHTML library is deprecated! It will be removed in nextcloud 19. globals.js:30:10
The following contact needed a correction that failed: duplicate types 
Object { jCal: (3) […], addressbook: {…}, vCard: {…}, conflict: false, dav: {…} }
validate.js:38:14
TypeError: "t is undefined"
    u ncvuecomponents.js:154
    beforeUpdate ncvuecomponents.js:154
    VueJS 6
vue.runtime.esm.js:1888:12
The escapeHTML library is deprecated! It will be removed in nextcloud 19. globals.js:30:10
TypeError: "t is undefined"
    u ncvuecomponents.js:154
    beforeUpdate ncvuecomponents.js:154
    VueJS 6
vue.runtime.esm.js:1888:12
The following contact needed a correction that failed: duplicate types 
Object { jCal: (3) […], addressbook: {…}, vCard: {…}, conflict: false, dav: {…} }
validate.js:38:14
TypeError: "t is undefined"
    u ncvuecomponents.js:154
    beforeUpdate ncvuecomponents.js:154
    VueJS 6
vue.runtime.esm.js:1888:12
The escapeHTML library is deprecated! It will be removed in nextcloud 19. globals.js:30:10
Locale used de 2 PropertyDateTime.vue:171
TypeError: "t is undefined"
    u ncvuecomponents.js:154
    beforeUpdate ncvuecomponents.js:154
    VueJS 6
vue.runtime.esm.js:1888:12
    VueJS 9_
ghost commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.

GRaptor commented 4 years ago

Any additional comment on this? Again, I expect here as well capability to import a vcard I exported with the same program.

GRaptor commented 4 years ago

Sorry to bring this up again. It's tagged as information needed. What is missing?

skjnldsv commented 4 years ago

I don't remember either!

GRaptor commented 4 years ago

Okay, I just tried the new 3.3.0 Same issue there - I exportet my test contact and the re-imported FAX shows wrong like described above.

skjnldsv commented 4 years ago

Yep, still not fixed :) I think this would require a fix in the mozilla ical.js library we're using (it handle all vcard parsing)

xplosionmind commented 1 year ago

I am experiencing the same issue!

Using Nextcloud 24.0.7 and Contacts 4.2.2 and also using Nextcloud 25.0.1 and Contacts 5.0.1

joshtrichards commented 8 months ago

Partially blocked on a new upstream release of ical.js: kewisch/ical.js#646

joshtrichards commented 5 months ago

New ical.js release is out: https://github.com/kewisch/ical.js/releases/tag/v2.0.0

joshtrichards commented 2 months ago

New ical.js is merged into Contacts so no longer a blocker: #3941