mozilla-b2g/gaia — pull request #13872 by gtorodelvalle (2013-11-20 15:31:00+00:00)
Title: Bug 917674 - [Contacts] Passive matching and merging when SIM contact's name is the same than an addressbook contact's last name

Currently, contacts imported from the SIM card with some content in the 'name' field, this content is loaded as the contact givenName (https://github.com/mozilla-b2g/gaia/blob/master/apps/communications/contacts/js/utilities/import_sim_contacts.js#L147). This causes that if a contact with some "Last Name" is exported to the SIM, this content is stored in the 'name' field. When reimporting the same contact, this content ("Last Name") is imported as the contact given name and according to this code https://github.com/mozilla-b2g/gaia/blob/master/apps/communications/contacts/js/contacts_matcher.js#L299 a match is found and both contacts are merged, ending up with a new contact with given name "Last Name" and last name "Last Name".