Problems with the LABEL parameter in VCFs in Contacts

Hello all,

I would like to ask some help/guidance on a bug that is “bugging” me for a long time, and mainly around the christmas(card) season:-)

I use glabels to print addresses on envelopes. This requires a vcf with the LABEL property correctly set. But Nextcloud contacts currently does not really handle the LABEL property very well. This is related to issue #1900

Here is a scenario I just recorded. I create a new contact for my friend John in the nextcloud web interface. When downloaded, the VCF looks like this:
BEGIN:VCARD
VERSION:3.0
PRODID:-//Sabre//Sabre VObject 4.3.5//EN
UID:ece76f19-2364-4f87-b33f-5367436357ee
FN:John Doe
ADR;TYPE=HOME:;;Kalverstraat 1;Amsterdam;;1234 AB;
EMAIL;TYPE=HOME:
TEL;TYPE=HOME,VOICE:
REV;VALUE=DATE-AND-OR-TIME:20211215T173237Z
END:VCARD

I sync it to my android phone and realize my friend John has moved to a new address, So I edit the contact on my phone. After a sync, the contact looks like this when downloaded again from the Nextcloud web interface:
BEGIN:VCARD
VERSION:3.0
PRODID:-//Sabre//Sabre VObject 4.3.5//EN
UID:ece76f19-2364-4f87-b33f-5367436357ee
FN:John Doe
N:Doe;John;;;
ADR;TYPE=home;LABEL=Leidse straat 2\nAmsterdam 5678 CD:;;Leidse straat 2;Am
sterdam;;5678 CD;
REV:20211215T173514Z
END:VCARD

Note that somewhere in the sync process the LABEL parameter is introduced in the ADR property. Strangely it is actually using the VCARD 4.0 syntax because in VCARD 3.0 LABEL is a separate property. (https://en.wikipedia.org/wiki/VCard or VCF - Virtual Contact File)

Later that year John moves yet again, and this time I edit his address on my laptop in the Nextcloud web interface. The vcard I download now comes out as:
BEGIN:VCARD
VERSION:3.0
PRODID:-//Sabre//Sabre VObject 4.3.5//EN
UID:ece76f19-2364-4f87-b33f-5367436357ee
FN:John Doe
N:Doe;John;;;
ADR;TYPE=home;LABEL=“Leidse straat 2^nAmsterdam 5678 CD”:;;Dam 3;Amsterdam;
;9876 FE;
REV;VALUE=DATE-AND-OR-TIME:20211215T173853Z
END:VCARD

Note now that all the other ADR parameters are completely out of sync with the LABEL parameter.
So my card goes to the wrong(old) address when I use glabels to print my mailing.

I see two separate problems here:

  1. Somewhere Nextcloud contacts seems to add the LABEL, but in a wrong syntax. I think it is Nextcloud who does this because I checked my phone by mailing the VCF, and it seems to use the VCARD 2.1 format and I didn’t see it add the LABEL parameter.

  2. the Contacts app doesn’t check or keep the LABEL in sync afterwards, causing havoc in the ADR property

I would like to work on this bug and improve this part over the next period. I already downloaded the source for nextcloud app, but I first wanted to check here if anyone has more/better info.
-Do you see this problem as well.
-Is it really Nextcloud adding the LABEL?
-Where in the source should I look for this then?

  • Any other ideas and pointers.

Some version info:
Nextcloud 22.2.3
Contacts app: 4.0.6

Kind Regards,

Bert

I’m trying to build the contacts app from git. But it ends at with

npm ERR! code EINTEGRITY
npm ERR! sha512-98U5mWmbPHGBmp8V7wqPx60zioFKETUGnoKYXc3Ih5YyRliw0ZqwrYezvSulpyYxwIWzDZXETE+TT94x9DpFSQ== integrity checksum failed when using sha512: wanted sha512-98U5mWmbPHGBmp8V7wqPx60zioFKETUGnoKYXc3Ih5YyRliw0ZqwrYezvSulpyYxwIWzDZXETE+TT94x9DpFSQ== but got sha512-eKafjKr47cXNc/vDf54St5wCdTbQL779xHqpXdmUH0uu8Wr6edNFCHYM0DpyB9g+3vp1ogGfgKOV2i0xfkpGzw==. (194261 bytes)

How can I solve this?

Bert

Hello all,

I made it one step further, the EINTEGRITY error turned out to be an issue with npm version.
sudo npm install -g npm@next
solved this, I am now on npm 8.3.0, coming from 7.5.2 (the standard on ubuntu 21.10)

Now I first want to figure out where the LABEL parameter is added, either by android/davx or in nextcloud. I am still very unfamiliar with the code. I went through bits of it, and learned form the app tutorial.
@skjnldsv, @ChristophWurst can you give me a pointer on where to look/start?

Regards,

Bert Haverkamp

I encountered this exact issue over the holiday. NextCloud shows the correct address with nothing to indicate what the LABEL is or even that it exists. However, syncing NextCloud with the contacts app on Android pulls the LABEL value as the address. The fix for me was to select “Add new property > Address” in NextCloud, re-enter the correct address, then delete the existing Address property. I could verify the fix by downloading the vcf file before and after the change. Once fixed, our Android devices were updated with the correct address.

Hi,

Thanks for your addition!. When do you see the label value being created? Is it during the sync from nextcloud->android, or android->nextcloud?
I’m still not sure when this is introduced. And by which software layer. I can’t see anything in the nextcloud app about the LABEL property. But on Android side also doesn’t make sense, as there vcard 2.1 seems to be used. Could it be due to some logic in DavX? Or in Sabre?

I only have 6 examples in my small database of this occurring. In every case, the problem shows up after having made a change on Android and then letting DAVx sync as scheduled.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.