After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 659553 - Can't link two google contacts together
Can't link two google contacts together
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: Contacts
3.2.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: evolution-addressbook-maintainers
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2011-09-20 08:43 UTC by Alexander Larsson
Modified: 2013-09-14 16:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix e_vcard_unescape_string (787 bytes, patch)
2011-09-20 10:27 UTC, Alexander Larsson
reviewed Details | Review
google: Handle multivalue custom vcard attributes (3.12 KB, patch)
2011-09-20 10:27 UTC, Alexander Larsson
reviewed Details | Review
google: Handle multivalue custom vcard attributes (3.87 KB, patch)
2011-09-20 12:10 UTC, Alexander Larsson
none Details | Review
Fix e_vcard_unescape_string (951 bytes, patch)
2011-09-20 12:20 UTC, Alexander Larsson
committed Details | Review
google: Handle multivalue custom vcard attributes (3.89 KB, patch)
2011-09-20 12:21 UTC, Alexander Larsson
accepted-commit_after_freeze Details | Review
google: Handle multivalue custom vcard attributes (3.94 KB, patch)
2011-09-20 12:50 UTC, Alexander Larsson
committed Details | Review

Description Alexander Larsson 2011-09-20 08:43:45 UTC
Seem like it only works if there is a local persona in there. 
Maybe there is a problem writing local-ids in the google eds backend?
Comment 1 Alexander Larsson 2011-09-20 09:08:42 UTC
** (gnome-contacts:18058): WARNING **: contacts-linking.vala:118: Unable to set local ids when linking: Unknown error setting property ‘local-ids’: Changing the ‘local-ids’ property failed due to reaching the timeout.

I get that after some time.
Comment 2 Alexander Larsson 2011-09-20 09:23:40 UTC
This is the cause of this:

(e-addressbook-factory:18891): libebookbackendgoogle-DEBUG: unsupported vcard field: X-FOLKS-CONTACTS-IDS: alexander.larsson@gmail.com:http://www.google.com/m8/feeds/contacts/alexander.larsson%40gmail.com/full/7be96ec58db596db

The eds backend only supports single-value vcard attributes.
Comment 3 Alexander Larsson 2011-09-20 10:27:47 UTC
Created attachment 197031 [details] [review]
Fix e_vcard_unescape_string

Actually append unescaped chars too
Comment 4 Alexander Larsson 2011-09-20 10:27:50 UTC
Created attachment 197032 [details] [review]
google: Handle multivalue custom vcard attributes

We use this by vcard escaping the individual attributes and joining them
with a comma. Then we name the attribute with a -MULTIVALUE prefix in order
to not confuse things with previously stored single-value attributes.
Comment 5 Milan Crha 2011-09-20 11:36:10 UTC
Review of attachment 197031 [details] [review]:

Good catch. But still, does it make any sense to use g_utf8_get_char() there (in both places in the function)? If there will be a two-byte UTF-8 letter, then the 'p' variable will point on its first byte, then in the second step on the second byte of it, thus the result will be some kind of crap, isn't it? The g_utf8_get_char() does not validate its input, thus the result is fairly undefined in such cases. Feel free to correct me, if I overlooked anything.
Comment 6 Alexander Larsson 2011-09-20 11:45:14 UTC
True, the unichar and g_utf8_get_char stuff is nonsense. We should just use *p.
Comment 7 Milan Crha 2011-09-20 11:47:27 UTC
Review of attachment 197032 [details] [review]:

I think there cannot be used this:
> +		values = g_strsplit (value, ",", 0);
when the multivalues string will contain a comma, then it's escaped by e_vcard_escape_string in the second chunk, but the escaping means "just" adding a backslash in front of it, thus the strsplit will divide the string incorrectly, with the preceding part ending with a "significant" backslash.
Comment 8 Alexander Larsson 2011-09-20 11:52:31 UTC
Ah, true. We need a custom string-split then. But eds must have something like that somewhere?
Comment 9 Alexander Larsson 2011-09-20 12:10:08 UTC
Created attachment 197042 [details] [review]
google: Handle multivalue custom vcard attributes

We use this by vcard escaping the individual attributes and joining them
with a comma. Then we name the attribute with a -MULTIVALUE prefix in order
to not confuse things with previously stored single-value attributes.
Comment 10 Alexander Larsson 2011-09-20 12:20:04 UTC
Created attachment 197044 [details] [review]
Fix e_vcard_unescape_string

Actually append unescaped chars, and don't bother with broken
unicode char stuff.
Comment 11 Alexander Larsson 2011-09-20 12:21:44 UTC
Created attachment 197045 [details] [review]
google: Handle multivalue custom vcard attributes

We use this by vcard escaping the individual attributes and joining them
with a comma. Then we name the attribute with a -MULTIVALUE prefix in order
to not confuse things with previously stored single-value attributes.
Comment 12 Milan Crha 2011-09-20 12:26:06 UTC
Review of attachment 197044 [details] [review]:

The change makes sense, thanks. Let's commit this after the hard code freeze into both master and stable branches.
Comment 13 Milan Crha 2011-09-20 12:41:25 UTC
Review of attachment 197045 [details] [review]:

Looks good too, only use 'gchar' type instead of the 'char' type, and if you want to check for non-empty values, then do that on both places in the foreach_extended_props_cb(), maybe together with a check whether value != NULL. Just in case.
Comment 14 Alexander Larsson 2011-09-20 12:50:51 UTC
Created attachment 197052 [details] [review]
google: Handle multivalue custom vcard attributes

We use this by vcard escaping the individual attributes and joining them
with a comma. Then we name the attribute with a -MULTIVALUE prefix in order
to not confuse things with previously stored single-value attributes.
Comment 15 Milan Crha 2011-09-20 12:54:01 UTC
Review of attachment 197052 [details] [review]:

Looks good, thanks.
Comment 16 Alexander Larsson 2011-09-20 13:47:00 UTC
I got acks to commit the google patch, but the unescape fix is not yet commited.
Comment 17 Milan Crha 2011-09-26 08:06:05 UTC
(For the fix of e_vcard_unescape_string)

Created commit ff67849 in eds master (3.3.1+)
Created commit 68611bd in eds gnome-3-2 (3.2.1+)