GNOME Bugzilla – Bug 545106
[Automatic Contacts] Adds duplicates email addresses
Last modified: 2014-03-24 16:24:25 UTC
This plugin is REALLY useful and comes in handy so many times. I don't know how to reproduce always, but I send lots of emails to the same person every workday and I keep getting more and more choices for the same e-mail each time I send a mail. I always fill the "To:" form typing some letters and when the drop-down list pops-down I go with the cursors/keyboard to the desired email account, hit return and then compose the mail. It's an Ubuntu Hardy (8.04), don't know if it helps. Also, I didn't find any bug related to this, so I'm hoping that isn't filled already with some weirdo name :)
If I'm not wrong, the contact will be listed in the drop-down the number of times it matches with number of address books which has this contact. So if you do not want this to happen then pro'ly you might want to delete this contact in all other address books leaving the one which requires. Does this suffice your requirement? If so you can close this bug, else you can suggest for any improvement in this feature. Thanks.
Sorry for the delay, I only have one address book. So that's not the problem.
*** Bug 569808 has been marked as a duplicate of this bug. ***
*** Bug 473867 has been marked as a duplicate of this bug. ***
In Evolution 2.30.3 I am seeing something that sounds like the same bug, so I will describe what's happening here: == Preferences == * Under Edit -> Preferences -> Mail Preferences -> Automatic contacts -> I have "create address book entries when sending mails" ticked, and the address book set to "auto-generated". * Under Edit -> Preferences -> Contacts, I have the auto-completion option enabled, and have 6 different address books enabled (one of these address books is "auto-generated", and let's assume another one is called "Personal"). * All the address books described above (the 6 including "auto-generated") are local address books. There is no LDAP/Exchange/etc involved. == What happens == 1) Say a have a contact for "Bob Johnson" with the email address of "bob@fake.com", in the "Personal" address book. This contact includes lots of other useful details, such as phone numbers, address, birthday, instant messaging, a picture, some notes, and so forth. 2) I compose an email to Bob, using auto-completion of his email address from the "Personal" address book, and I send that email. 3) Another new contact for Bob, with just his email address alone, will be added to the "auto-generated" address book. == Why this is a problem == * Step 3 duplicates an existing contact. I already have Bob in an address book. * This is no point in making an inferior duplicate of an already known contact. The contact in the "Personal" folder has much more detail. * At some later point, I will have manually go through the auto-generated contacts, and delete contacts that are duplicates. Also at some point Bob may change email address, and now since there are two copies of the same information, it's easy to miss the auto-generated one, and the old invalid email address will still be suggested. * Duplication is annoying :-) * Duplication is annoying :-) * I have seen the behavior described by the OP, where the same email address for the same person is suggested lots and lots of times. I just cleaned out my auto-generated address book to prevent this. == What should happen == To prevent these problems: * If the same email address is already used by a contact in an auto-completion address book, then do not add a new contact to the auto-generated contact list. * This will prevent duplicates from being created. * The auto-generated address book should thereafter only get additions for new and unknown email addresses that are not already in any of the auto-completion address books.
*** Bug 340390 has been marked as a duplicate of this bug. ***
Created attachment 272036 [details] [review] Proposed patch
Proposed patch above walks through all addressbooks and searches for a matching contact. If not found, the contact is added as it used to be. Please let me know if there is a better way to do it.
Review of attachment 272036 [details] [review]: Thanks for the patch, I have nothing significant against it as it is, the mentioned things are mostly about coding style issues, and it is pretty minor. The "other approach" you mentioned is doable, as an enhancement of your current patch: a) the bbdb plugin can safely skip autocompleted contacts from the composer; such contacts are recognized by non-NULL returned pointer from e_destination_get_contact() b) there is still needed what you did, to check addressbooks, in cases where a user is too quick and writes an address which is already in the book, but he/she writes it quickly enough that the autocompletion will be slow and avoided. The enhancement of the patch will be to: b1) check only books which are marked for autocompletion (e_source_autocomplete_get_include_me(), but make sure you'll not add this extension if it's not there) b2) check only in enabled books (e_source_registry_list_enabled()) ::: plugins/bbdb/bbdb.c @@ +312,3 @@ + client_cache, (ESource *) aux_addressbooks->data, + E_SOURCE_EXTENSION_ADDRESS_BOOK, + NULL, &error); //Treat error a) coding style: no C++ comments, please b) the 'error', if set, is leaked here, and/or reused inappropriately later in the code @@ +322,3 @@ + g_free (temp_name); + g_list_free_full (addressbooks, (GDestroyNotify) g_object_unref); + g_object_unref(client_addressbook); coding style: missing space after 'g_object_unref' (this is there multiple times) @@ +367,3 @@ + g_warning ( + "bbdb: Could not modify contact: %s\n", + error->message); this needs better indentation, no need to go that far
Created attachment 272355 [details] [review] Proposed patch Thanks for the feedback. I have made the enhancements.
Review of attachment 272355 [details] [review]: Looks good, just one coding style typo (in the use of e_source_registry_list_enabled) and, please, do not pile patches this way, rather create an updated patch which changes each soruce file only once the next time. Thanks in advance.
Created commit 7830511 in evo master (3.13.1+) [1] Created commit a132c1f in evo evolution-3-12 (3.12.1+) [1] https://git.gnome.org/browse/evolution/commit/?id=7830511