GNOME Bugzilla – Bug 566441
The Google backend doesn't use the tags/categories/groups
Last modified: 2012-03-24 19:48:29 UTC
Please describe the problem: Google organizes the contacts into "user groups" which work as "tags" or "categories". Thus the Google backend should translate those "user groups" into the "categories". See documentation: a) how to fetch contact groups feed (needed to translate the group ID to it's name): http://code.google.com/apis/contacts/docs/2.0/reference.html#ContactGroupsFeed b) gContact:groupMembershipInfo property of a contact: http://code.google.com/apis/contacts/docs/2.0/reference.html#groupMembershipInfo Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information:
*** Bug 566464 has been marked as a duplicate of this bug. ***
*** Bug 604020 has been marked as a duplicate of this bug. ***
*** Bug 585684 has been marked as a duplicate of this bug. ***
Agreed, it's unfortunate that Evolution's feature of syncing with Google contacts does not include the group tags used by Google :(
This is a irritating 'bug'. I've just organized my contacts in gmail and I'm not able to do this in evolution. Do you have plans to solve tis issue?
Created attachment 174907 [details] [review] Merge utility functions into the Google Contacts backend The first patch in a set of three, this merges the util.[ch] code into the main C file for the Google Contacts backend, which is necessary for some of the refactoring in the third patch.
Created attachment 174908 [details] [review] gcc warning fixes The second patch of three, this just fixes some gcc warnings in the Google Contacts backend. It's not strictly necessary to fix this bug, but the warnings were annoying me.
Created attachment 174909 [details] [review] Add category support to the Google Contacts backend The third patch of three, this adds category support to the Google Contacts backend. The patch should work for libgdata < 0.7 as well as libgdata >= 0.7. Since the group list needs to be downloaded separately from the list of contacts, the cache expiry logic needed some work. Note that the list of groups currently isn't cached, so has to be downloaded from the server (one request) every time the address book factory is started.
After some further testing, it appears that the "#ifndef HAVE_GDATA_07" shouldn't be added to sanitise_group_id() in the third patch. Everything else should be fine though. I'll produce an updated patch after it's been reviewed.
Milan, Matthew, ping?
Patches looks good, there is nothing much to review on them, apart of testing. It happened to me that e-addressbook-factory crashed for me, with these patches and libgdata-0.6.4-4.fc14, so there might be done some improvements, probably in libgdata itself:
+ Trace 225215
With libgdata git master (commit 3dfd4de) it produces this compiler warning: e-book-backend-google.c: In function 'sanitise_group_id': e-book-backend-google.c:561:14: warning: unused variable 'base' and in runtime it doesn't seem to work, because I have only few contacts which have set a group, and from the debugging output: > libebookbackendgoogle-DEBUG: Group feed has 4 entries > libebookbackendgoogle-DEBUG: process_group > libebookbackendgoogle-DEBUG: Processing group http://www.google.com/m8/feeds/groups/xxx%40gmail.com/full/6, Personal > libebookbackendgoogle-DEBUG: process_group > libebookbackendgoogle-DEBUG: Processing group http://www.google.com/m8/feeds/groups/xxx%40gmail.com/full/d, Friends > libebookbackendgoogle-DEBUG: process_group > libebookbackendgoogle-DEBUG: Processing group http://www.google.com/m8/feeds/groups/xxx%40gmail.com/full/e, Family > libebookbackendgoogle-DEBUG: process_group > libebookbackendgoogle-DEBUG: Processing group http://www.google.com/m8/feeds/groups/xxx%40gmail.com/full/f, Coworkers > libebookbackendgoogle-DEBUG: get_new_contacts_in_chunks > libebookbackendgoogle-DEBUG: Feed has 17 entries > libebookbackendgoogle-DEBUG: process_initial_entry > libebookbackendgoogle-DEBUG: process_initial_entry > libebookbackendgoogle-DEBUG: process_initial_entry > libebookbackendgoogle-WARNING **: Couldn't find name for category with ID ''. > libebookbackendgoogle-WARNING **: Couldn't find name for category with ID ''. > libebookbackendgoogle-DEBUG: process_initial_entry > libebookbackendgoogle-DEBUG: process_initial_entry > libebookbackendgoogle-DEBUG: process_initial_entry > libebookbackendgoogle-WARNING **: Couldn't find name for category with ID ''. > libebookbackendgoogle-DEBUG: process_initial_entry > libebookbackendgoogle-WARNING **: Couldn't find name for category with ID ''. > libebookbackendgoogle-WARNING **: Couldn't find name for category with ID ''. I also expect that the contacts will be updated automatically, when run evolution with these patches included, because I invoked refetch only by removing local google's backend contacts cache.
(In reply to comment #11) > Patches looks good, there is nothing much to review on them, apart of testing. > It happened to me that e-addressbook-factory crashed for me, with these patches > and > libgdata-0.6.4-4.fc14, so there might be done some improvements, probably in > libgdata itself: I can't reproduce that. Would you be able to get a more complete stack trace and open a bug against libgdata with it please? (In reply to comment #12) > With libgdata git master (commit 3dfd4de) it produces this compiler warning: > > e-book-backend-google.c: In function 'sanitise_group_id': > e-book-backend-google.c:561:14: warning: unused variable 'base' See comment #9. Try removing the “#ifndef HAVE_GDATA_07” from sanitise_group_id() and see if it works then.
Pushed the first two patches to master: commit 585eb01ed13e923eeff39132f266f3d86a1a1218 Author: Philip Withnall <philip@tecnocode.co.uk> Date: Tue Jul 20 20:32:30 2010 +0100 gcc warning fixes Variables shadowing various libc functions and a potentially-uninitialised variable. .../backends/google/e-book-backend-google.c | 170 ++++++++++---------- 1 files changed, 84 insertions(+), 86 deletions(-) commit 83acb8b4833ea364fd053f730404900b3b4e0820 Author: Philip Withnall <philip@tecnocode.co.uk> Date: Tue Jul 20 20:19:15 2010 +0100 Merge utility functions into Google Contacts backend addressbook/backends/google/Makefile.am | 2 - .../backends/google/e-book-backend-google.c | 1171 +++++++++++++++++++- addressbook/backends/google/util.c | 1183 -------------------- addressbook/backends/google/util.h | 42 - 4 files changed, 1166 insertions(+), 1232 deletions(-)
Can this be closed or is there more to do?
Patch #174909 still needs to be committed. It should be fine, apart from the following change which needs making before it's committed: "#ifndef HAVE_GDATA_07" shouldn't be added to sanitise_group_id()
Created attachment 177373 [details] [review] Add category support to the Google Contacts backend (updated) Updated version of the third patch, rebased against master and containing the change mentioned in comment #16. To clear up any confusion, this is the only patch which still needs committing. I guess it's already been partially reviewed by Milan.
I tried the patch up through comment 16 and am experiencing a different issue. I'm able to create a new contact, select categories and save. When I check google through the web, the contact is there and includes the correct categories. However, back on evolution, the contact does not show any categories. I can open this same contact, select new categories into the blank categories field, and save. Checking google web, the contact was updated with the new categories.
I rebased against master tonight and applied the patch from comment 17. This resolved my problem from comment 18.
OK, the patch above seems to read the values properly and storing them in categories. There is some issue with other changes, and an update on start (I moved a contact to Friend label in google web interface and then run evolution and e-addressbook-factory and this change wasn't recognized, but clearing the cache local addressbook and re-running these two processes led to a fetch with correct values. Thus I guess it can be committed, with one exception: What is the actual libgdata gnome requirement? The libgdata-0.6.4 is crashing with this patch, so if the crash (see comment #11) is fixed in any later version of libgdata which is also officially available in an unstable release of gnome, then we can depend on it and everything is fine. If not, then the patch should wait for the proper libgdata version availability in gnome itself.
(In reply to comment #20) > OK, the patch above seems to read the values properly and storing them in > categories. There is some issue with other changes, and an update on start (I > moved a contact to Friend label in google web interface and then run evolution > and e-addressbook-factory and this change wasn't recognized, but clearing the > cache local addressbook and re-running these two processes led to a fetch with > correct values. Thus I guess it can be committed, with one exception: I think it's unavoidable for the cache to have to be cleared after a user upgrades to an e-d-s with these changes, as the old cache won't contain any of the groups data in the vCard representations of all the contacts. I took a look at the code in libgdata, but I couldn't reproduce your crash (or see what could be causing it). Could you get a more detailed stacktrace and open a bug against libgdata with it please? > What is the actual libgdata gnome requirement? The libgdata-0.6.4 is crashing > with this patch, so if the crash (see comment #11) is fixed in any later > version of libgdata which is also officially available in an unstable release > of gnome, then we can depend on it and everything is fine. If not, then the > patch should wait for the proper libgdata version availability in gnome itself. I think the minimum requirement is 0.6.4. GNOME's recommended dependency on libgdata is 0.6.6 at the moment, and its minimum is 0.6.4; but I've requested for the minimum to be bumped to 0.8.0. The whole backend will need updating due to API breaks between 0.7.x and 0.8.0, but I'll do that separately. If my request to bump GNOME's dependency to 0.8.0 isn't accepted, I could probably make a 0.6.7 release with a fix for your crash, but it's getting quite hard to maintain the 0.6.x branch in the face of all the changes between it and 0.8.0.
Since nobody objected, I've bumped GNOME 3.0's minimum dependency on libgdata to 0.8.0. Once this patch is committed, I'll ensure that the backend compiles and works against 0.8.0.
(In reply to comment #22) > Since nobody objected, I've bumped GNOME 3.0's minimum dependency on libgdata > to 0.8.0. Once this patch is committed, I'll ensure that the backend compiles > and works against 0.8.0. Good, in that case feel free to commit to sources and bump libgdata version requirement in evolution and evolution-data-server too. Thanks.
It turns out that the API breaks between 0.7.x and 0.8.0 didn't affect this e-d-s work or the libgdata code in Evolution. I've bumped e-d-s' dependency to 0.7.0 and dropped the various #ifdefs, though. commit f5230b89b1b928b5d145a7b1bb3c8f6f06c12c82 Author: Philip Withnall <philip@tecnocode.co.uk> Date: Tue Jul 20 09:28:49 2010 +0100 Bug 566441 — The Google backend doesn't use the tags/categories/groups Support categorising contacts using Google Contacts' groups. This includes a mapping of Google's system groups onto some of the default Evolution groups, plus support for arbitrary groups. The patch can optionally use libgdata 0.7's improved support for Google Contacts groups. Closes: bgo#566441 .../backends/google/e-book-backend-google.c | 346 +++++++++++++++++--- 1 files changed, 304 insertions(+), 42 deletions(-) commit 69b8607f2dd6d399306905e011a6565319190066 Author: Philip Withnall <philip@tecnocode.co.uk> Date: Sat Jan 15 14:35:08 2011 +0000 Bump libgdata dependency to 0.7.0 The minimum dependency in GNOME is now 0.8.0, so we can bump the e-d-s dependency to 0.7.0 and remove the various #ifdefs. See: bgo#566441 .../backends/google/e-book-backend-google.c | 77 -------------------- configure.ac | 10 +--- 2 files changed, 1 insertions(+), 86 deletions(-)