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 630358 - Google contacts doesn't sync birthday and URL
Google contacts doesn't sync birthday and URL
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: Contacts
unspecified
Other Linux
: Normal normal
: ---
Assigned To: evolution-addressbook-maintainers
Evolution QA team
: 631362 631663 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-09-22 19:09 UTC by Marcus
Modified: 2011-03-09 12:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
eds patch (7.02 KB, patch)
2010-10-13 10:21 UTC, Milan Crha
committed Details | Review
eds patch ][ (3.20 KB, patch)
2010-10-14 08:38 UTC, Milan Crha
committed Details | Review
eds patch ]I[ (2.56 KB, patch)
2010-10-14 16:21 UTC, Milan Crha
committed Details | Review

Description Marcus 2010-09-22 19:09:33 UTC
Evolution doesn't show birthday for google contacts
Comment 1 Milan Crha 2010-09-27 19:08:48 UTC
Thanks for a bug report. Evolution is using libgdata and I didn't find API for this field, thus I'm moving this to libgdata.

There is also a URL field in both Google and Evolution, which is not synced.
Comment 2 Philip Withnall 2010-09-29 10:10:48 UTC
libgdata master has gdata_contacts_contact_[get|set]_birthday(), which will be available in 0.7.0.

http://git.gnome.org/browse/libgdata/tree/gdata/services/contacts/gdata-contacts-contact.h#n170

Changing the product so it's an e-d-s bug to make use of the functions once libgdata 0.7.0 is released and e-d-s depends on it.
Comment 3 Milan Crha 2010-09-29 11:04:51 UTC
OK, thanks. What about that URL field?
Comment 4 Philip Withnall 2010-09-29 11:48:26 UTC
Should be covered by the website functions in the same class:

http://git.gnome.org/browse/libgdata/tree/gdata/services/contacts/gdata-contacts-contact.h#n239
Comment 5 Milan Crha 2010-10-13 10:21:52 UTC
Created attachment 172244 [details] [review]
eds patch

for evolution-data-server;

Though this is still waiting for libgdata 0.7, then there weren't as that many API changes, thus I got eds ready for it, so when the eds will be compiled against 0.7 or higher libgdata, then fields like birthday, home page url and blog url will be available in UI and will be synced forth and back from the Google server.

Philip, I noticed they support also anniversary dates, it would be nice to have API for it in 0.7 too. Also, I'm ignoring dates without year, I've not much idea what to do with such dates, because evolution depends on the birthday year.
Comment 6 Milan Crha 2010-10-13 10:23:50 UTC
Created commit b1c896e in eds master (2.91.1+)
Comment 7 Philip Withnall 2010-10-13 20:57:39 UTC
(In reply to comment #5)
> Created an attachment (id=172244) [details] [review]
> eds patch
> 
> for evolution-data-server;
> 
> Though this is still waiting for libgdata 0.7, then there weren't as that many
> API changes, thus I got eds ready for it, so when the eds will be compiled
> against 0.7 or higher libgdata, then fields like birthday, home page url and
> blog url will be available in UI and will be synced forth and back from the
> Google server.

Thanks for doing this!

> Philip, I noticed they support also anniversary dates, it would be nice to have
> API for it in 0.7 too. Also, I'm ignoring dates without year, I've not much
> idea what to do with such dates, because evolution depends on the birthday
> year.

Anniversaries are supported as a type of “event”: http://code.google.com/apis/contacts/docs/3.0/reference.html#gcEvent. You can access them using the event API on GDataContactsContact: http://git.gnome.org/browse/libgdata/tree/gdata/services/contacts/gdata-contacts-contact.h#n244.

Couldn't you just use the current year if the year is missing? That would prevent data loss in the case that someone's just stored the day and month (which is all one really needs to store in most cases).
Comment 8 Milan Crha 2010-10-14 07:08:58 UTC
(In reply to comment #7)
> Anniversaries are supported as a type of “event”:

Aha, I wouldn't expect it there.
 
> Couldn't you just use the current year if the year is missing?

Yes, I thought of that, but it'll break years-old computation and most notably if you edit the contact in evolution then it'll write there its year. Though maybe it's better than data-loss.
Comment 9 Milan Crha 2010-10-14 08:38:11 UTC
Created attachment 172335 [details] [review]
eds patch ][

for evolution-data-server;

And anniversary + birth day without year (though this is untested).
Comment 10 Milan Crha 2010-10-14 08:39:39 UTC
Created commit bad12c4 in eds master (2.91.1+)
Comment 11 Philip Withnall 2010-10-14 08:55:11 UTC
(In reply to comment #9)
> Created an attachment (id=172335) [details] [review]
> eds patch ][
> 
> for evolution-data-server;
> 
> And anniversary + birth day without year (though this is untested).

Instead of calling gdata_contacts_contact_remove_all_events(), you should probably loop through and only delete the anniversary events, rather than all events. Data loss (of non-anniversary events) could occur otherwise.

This is probably true of websites/blogs too.
Comment 12 Milan Crha 2010-10-14 16:21:55 UTC
Created attachment 172364 [details] [review]
eds patch ]I[

for evolution-data-server;

Aha, I thought it's creating a new 'event' from scratch, and those 'remove_all' are there just to be sure, but I see that events are recreated from the cache and updated accordingly to user changes.

The only issue is that the order changes, and updated anniversary and/or homepage/blog websites are at the bottom. Not much I can do with it, right? Unless we've some remove_reltype for both events and websites and 'add' taking care of duplicates, because otherwise it's too complicated code for this. (And I know, that's also hard to find duplicates in events.) Anyway...

Created commit 003ebce in eds master (2.91.1+)
Comment 13 Philip Withnall 2010-10-14 19:29:51 UTC
(In reply to comment #12)
> The only issue is that the order changes, and updated anniversary and/or
> homepage/blog websites are at the bottom. Not much I can do with it, right?

That shouldn't be an issue.

> Unless we've some remove_reltype for both events and websites and 'add' taking
> care of duplicates, because otherwise it's too complicated code for this. (And
> I know, that's also hard to find duplicates in events.) Anyway...

The problem with adding API like *_remove_reltype() to libgdata is that if I add it for events, it also has to be added for websites, calendars, hobbies, languages, external IDs, etc. That rapidly turns into an awful lot of very repetitive API.

I'm considering moving to some kind of API when GDataContactsContact would export a container object for each of {websites, calendars, hobbies, languages, …}, and the container would provide a uniform interface for interacting with the collection of items. e.g.

  GDataCollection *collection = gdata_contacts_contact_get_events ();
  Event *some_event = gdata_collection_get (collection, "some-id");
  gdata_collection_remove_by_relation_type (collection, ANNIVERSARY);
  gdata_collection_add (collection, some_other_event);

How does that sound? I'm not sure it would make 0.7 though, as I don't have much free time at the moment.
Comment 14 Milan Crha 2010-10-15 06:21:00 UTC
(In reply to comment #13)
> The problem with adding API like *_remove_reltype() to libgdata is that if I
> add it for events, it also has to be added for websites, calendars, hobbies,
> languages, external IDs, etc. That rapidly turns into an awful lot of very
> repetitive API.
> ...

Yeah, I know, it's all about very similar API for different properties. And to be honest I do not care much at the moment, I have it done for google contacts in evolution already, so it was just an idea.
Comment 15 Milan Crha 2010-10-20 12:32:45 UTC
*** Bug 631362 has been marked as a duplicate of this bug. ***
Comment 16 Milan Crha 2010-10-20 15:07:56 UTC
*** Bug 631663 has been marked as a duplicate of this bug. ***
Comment 17 daniel friedrich 2011-03-08 22:07:02 UTC
Birthday from evolution are not visible in gmail-contacts after transfer by sync-ui (syncml).
Evolution-Version: 2.30.3
Comment 18 Milan Crha 2011-03-09 07:19:05 UTC
(In reply to comment #17)
> Birthday from evolution are not visible in gmail-contacts after transfer by
> sync-ui (syncml).
> Evolution-Version: 2.30.3

It doesn't surprise that much if you read comment #6, comment #10, comment #12 carefully...
Comment 19 daniel friedrich 2011-03-09 07:53:54 UTC
Oooops =) I did not checked the version because the comment was older so i thought it must be still in my evolution... Sorry =)
Comment 20 Milan Crha 2011-03-09 12:09:11 UTC
(In reply to comment #19)
> Oooops =) I did not checked the version because the comment was older so i
> thought it must be still in my evolution... Sorry =)

No problem, this bug history is quite confusing, with its three patches instead of just one :)