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

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

Open
GRaptor opened this issue Oct 6, 2019 · 16 comments · Fixed by kewisch/ical.js#517
Open

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

GRaptor opened this issue Oct 6, 2019 · 16 comments · Fixed by kewisch/ical.js#517
Labels
1. to develop Accepted and waiting to be taken care of bug Something isn't working dependencies feature: import Importing (and exporting)

Comments

@GRaptor
Copy link

GRaptor commented Oct 6, 2019

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

@GRaptor GRaptor added 0. Needs triage bug Something isn't working labels Oct 6, 2019
@GRaptor GRaptor changed the title exported vCard is re-imported incorrect exported vCard phone number with ; or , is re-imported incorrect Oct 6, 2019
@skjnldsv
Copy link
Member

skjnldsv commented Oct 7, 2019

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? 🤔

@skjnldsv skjnldsv added the needs info Not enough information provided label Oct 7, 2019
@GRaptor
Copy link
Author

GRaptor commented Oct 8, 2019

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
Copy link
Member

skjnldsv commented Oct 8, 2019

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
Copy link
Member

skjnldsv commented Oct 8, 2019

Ah sorry, I've been bamboozled by the github formatting of \; in my previous message
#1297 (comment)

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

@skjnldsv
Copy link
Member

skjnldsv commented Oct 8, 2019

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
Copy link
Author

GRaptor commented Oct 8, 2019

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

This comment has been minimized.

@ghost ghost added the stale label Nov 7, 2019
@GRaptor
Copy link
Author

GRaptor commented Nov 8, 2019

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

@ghost ghost removed the stale label Nov 8, 2019
@GRaptor
Copy link
Author

GRaptor commented Dec 5, 2019

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

@skjnldsv
Copy link
Member

skjnldsv commented Dec 6, 2019

I don't remember either!

@skjnldsv skjnldsv added 1. to develop Accepted and waiting to be taken care of and removed 0. Needs triage needs info Not enough information provided labels Dec 6, 2019
@GRaptor
Copy link
Author

GRaptor commented Apr 14, 2020

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
Copy link
Member

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
Copy link

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
Copy link
Member

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

@joshtrichards joshtrichards added the feature: import Importing (and exporting) label Jan 15, 2024
@joshtrichards
Copy link
Member

@joshtrichards
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Accepted and waiting to be taken care of bug Something isn't working dependencies feature: import Importing (and exporting)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants