Closed Bug 1792399 Opened 3 years ago Closed 3 years ago

Address Book truncates VCARD `CATEGORIES` field

Categories

(Thunderbird :: Address Book, defect)

Thunderbird 102
defect

Tracking

(thunderbird_esr102 fixed, thunderbird106 fixed)

RESOLVED FIXED
107 Branch
Tracking Status
thunderbird_esr102 --- fixed
thunderbird106 --- fixed

People

(Reporter: bugzilla, Assigned: darktrojan)

Details

Attachments

(1 file)

Steps to reproduce:

I have a nextcloud address book that I sync to a few devices. I have contacts in various CATEGORIES. One contact might be a "Friends" and also in the "Sports" category and maybe even in a third one like "School" you get the idea.

Actual results:

When I interact with contacts (write a mail, for example), the contact gets changed and synced back to nextcloud. It will now have lost all but one of its CATEGORIES. The person described above will now only be in "Friends", but no longer in "Sports" or "School". The information is simply lost.

There are other changes, too, but those changes are usually just syntactic.

Expected results:

A contact should not lose information.

I also back up my contacts to a git repository. I included a typical diff of a contact-change. I did not manually change anything about that contact, I only used that one to send an email. Personal info redacted.

diff --git a/redacted_-_2c8681c7xx.vcf b/redacted_-_2c8681c7xx.vcf
index 6a527ef..81449d5 100644
--- a/redacted_-_2c8681c7xx.vcf
+++ b/redacted_-_2c8681c7xx.vcf
@@ -5,13 +5,13 @@ X-OPEN-XCHANGE-CTYPE:contact
 UID:2c8681c7xx
 FN:Hans Mustermann
 N:Mustermann;Hans;;;
-TEL;TYPE=HOME,VOICE:+49 1234 5678
+TEL;TYPE="HOME,VOICE":+49 1234 5678
 TEL;TYPE=CELL:+49 123 45 67 890
 EMAIL;TYPE=HOME:mail@example.com
-ADR;TYPE=home;LABEL=street name 10\n12345 city\nprovince\nDEUTSCHLAND:;
- ;street name 10;city;province;12345;Deutschland
-CATEGORIES:Friends,Sports,School                                <----- THIS ONE
-BDAY:19700101
+ADR;TYPE=home;LABEL=street name 10^n12345 city^nprovince^nDEUTSCHLAND:
+ ;;street name 10;city;province;12345;Deutschland
+CATEGORIES:Friends                                <----- THIS ONE
+BDAY;VALUE=DATE:19700101
 REV:20170907T061947Z
-END:VCARD
\ No newline at end of file
+END:VCARD

as I said, most changes are benign, but the CATEGORIES field is losing information.

That's weird. The categories field shouldn't be changed at all since we don't do anything with it.

I think I can see what's going on here.

Assignee: nobody → geoff
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

If a vCard content line has multiple values (CATEGORIES and NICKNAME in vCard 4, also NOTE in vCard 3), the values appear in the parsed data structure as items 4...n.
(See https://github.com/kewisch/ical.js/blob/7fb7b51f1b36d49b576a359ee178d85e6d4b192a/lib/ical/parse.js#L291-L293 for where this happens.)
Until now we've been assuming there are only four items, so the second and subsequent values have been lost.

This patch collapses the multiple values into an array for VCardPropertyEntry, and expands them again before sending the data back to ICAL.stringify.

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/f2ab1e7387d2
Store multiple values as an array in VCardPropertyEntry. r=aleca

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 107 Branch

Thank you for this very swift fix! Might I inquire if this could also be applied to 102.x? I'm currently losing groups on contacts every day I work with Thunderbird, I would hate for this to continue for the next few months.

(In reply to Claudius from comment #5)

Thank you for this very swift fix! Might I inquire if this could also be applied to 102.x?

  • status-thunderbird_esr102 = WONTFIX, indicates patch won't be applied to version 102
  • status-thunderbird_esr102 = UNAFFECtED indicates it is believed version 102 does not have the bug
  • status-thunderbird_esr102 = AFFECTED indicates the patch is expected to eventually be applied to version 102 after some time on the nightly build version, then on the beta version, then applied to version 102. After a bug report is marked FIXED, it typically takes 2-4 weeks for a patch to be applied to, and shipped in, version 102

Thank you for clarifying. The "milestone 107" was what threw me off.

Comment on attachment 9296279 [details]
Bug 1792399 - Store multiple values as an array in VCardPropertyEntry. r=#thunderbird-reviewers

[Approval Request Comment]
Regression caused by (bug #): switch to vCard storage
User impact if declined: contacts lose information when saved, even if no changes were made
Testing completed (on c-c, etc.): landed this week
Risk to taking this patch (and alternatives if risky): hopefully low, this is an edge case

Attachment #9296279 - Flags: approval-comm-beta?

Comment on attachment 9296279 [details]
Bug 1792399 - Store multiple values as an array in VCardPropertyEntry. r=#thunderbird-reviewers

[Triage Comment]
Approved for beta

Attachment #9296279 - Flags: approval-comm-beta? → approval-comm-beta+

https://github.com/jobisoft/TbSync/issues/591 has noted this is needed for avoid datalos for the tbsync addon

(In reply to Wayne Mery (:wsmwk) from comment #11)

https://github.com/jobisoft/TbSync/issues/591 has noted this is needed for avoid datalos for the tbsync addon

needed on v102. So, good to uplift?

Flags: needinfo?(geoff)

Comment on attachment 9296279 [details]
Bug 1792399 - Store multiple values as an array in VCardPropertyEntry. r=#thunderbird-reviewers

[Approval Request Comment]
Go on then. I'd prefer it to have another week, but whatever.

Flags: needinfo?(geoff)
Attachment #9296279 - Flags: approval-comm-esr102?

Comment on attachment 9296279 [details]
Bug 1792399 - Store multiple values as an array in VCardPropertyEntry. r=#thunderbird-reviewers

[Triage Comment]
Approved for esr102

Attachment #9296279 - Flags: approval-comm-esr102? → approval-comm-esr102+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: