6.0.0-git
2020-02-25

[#14944] CardDAV: Bad comma separation for CATEGORIES property, aka tags
Summary CardDAV: Bad comma separation for CATEGORIES property, aka tags
Queue Turba
Queue Version FRAMEWORK_5_2
Type Bug
State Not A Bug
Priority 1. Low
Owners mrubinsk (at) horde (dot) org
Requester bugs.horde.org (at) ulle (dot) dyndns (dot) org
Created 2019-08-20 (189 days ago)
Due
Updated 2019-09-30 (148 days ago)
Assigned 2019-09-28 (150 days ago)
Resolved 2019-09-30 (148 days ago)
Milestone
Patch No

History
2019-09-30 17:46:23 Michael Rubinsky State ⇒ Not A Bug
 
2019-09-29 20:54:54 bugs (dot) horde (dot) org (at) ulle (dot) dyndns (dot) org Comment #4 Reply to this comment
Thanks for digging into this. And for pointing out where I was wrong.

The trimming for CardDAV export is done in function tovCard(...) , 
case '__tags':
https://github.com/horde/turba/blob/master/lib/Driver.php#L1818
leading to 
https://github.com/horde/Core/blob/master/lib/Horde/Core/Tagger.php#L89

I was seeing the misbehavior with a Debian Jessie installation (which 
is oldoldstable now), where
case '__tags': is not calling Turba_Tagger::split() but doing a simple 
explode(',', $val) instead. And unfortunately I thought the error is 
caused by synchronizeTags(), which hasn't changed much since then.

So this was fixed ages ago, for Debian since Stretch/9 , as I see now.
Sorry for stealing your time, Michael.
...and I can't reproduce this using the 'Card Book' add on to 
Thunderbird as described in the ticket.  My tags are being correctly 
trimmed as they are synchronized.

Please provide a step-by-step way of reproducing this.
2019-09-28 19:17:19 Michael Rubinsky Comment #3
Priority ⇒ 1. Low
Reply to this comment
...and I can't reproduce this using the 'Card Book' add on to 
Thunderbird as described in the ticket.  My tags are being correctly 
trimmed as they are synchronized.

Please provide a step-by-step way of reproducing this.
2019-09-28 18:58:19 Michael Rubinsky Comment #2
Assigned to Michael Rubinsky
State ⇒ Feedback
Reply to this comment
Yes, we store it with a comma-space separator, but only internally in 
Turba. When the Turba_Object is converted to a vCard, this property is 
split and trimmed in Turba_Tagger::split();

I'll have to trace the code after I get a Thunderbird install going to 
see where this is(not) happening.

[Show Quoted Text - 24 lines]
2019-08-20 11:55:34 bugs (dot) horde (dot) org (at) ulle (dot) dyndns (dot) org Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 2. Medium
Summary ⇒ CardDAV: Bad comma separation for CATEGORIES property, aka tags
Queue ⇒ Turba
Milestone ⇒
Patch ⇒ No
Reply to this comment
When syncing address book entry via CardDAV Horde is sending the 
CATEGORIES property with wrong separation. Horde internally uses 
categories as tags (or vice versa).

RFC is postulating for CATEGORIES property value: "One or more text 
values separated by a COMMA character"
https://tools.ietf.org/html/rfc6350#section-6.7.1

Horde separates by a comma and a space character.

This misbeavior is coming from function synchronizeTags(array $tags) 
in turba/lib/Object.php
...
$this->setValue('__tags', implode(', ', $tags));
...
https://github.com/horde/turba/blob/master/lib/Object.php#L313

Some CardDAV clients , for example Thunderbird plugin CardBook, adding 
the additional space char to the name of the category . As CardBook is 
using categories for grouping cards, this leads to lots of confusion.

Looking forward to seeing this fixed.

Saved Queries