Closed Bug 860804 Opened 7 years ago Closed Last year

[sms] Can't search for a middle name


(Core Graveyard :: DOM: Contacts, defect, P5)



(b2g18+ affected)

Tracking Status
b2g18 + affected


(Reporter: julienw, Unassigned)



(1 file)

* have a contact like "Juan Carlos Alfonso Víctor María de Borbón y Borbón-Dos Sicilias" (more than 2 words in the given name, more than 2 words in the last name)
* search for eg "carlos"

* we should find the contact

* we find nothing

This may be a Contacts API bug:
* either we should be able to search _inside_ a property
* or a 2-word givenName should be stored as an array (or something like this), and the index should cover this.
Attached image 2014-03-16-09-32-05.png
I added this contact in the contact App
Then, I tried to find this contact in the contact App and it works. 

But in the sms app, I can't find this contact, even if I find the first name. 
Is it maybe because I use desktop client instead of a real phone ?

If I can resolve this problem I would be happy to work on this bug :)
(In reply to AxelR from comment #1)
> If I can resolve this problem I would be happy to work on this bug :)

The contacts matching code is different between the SMS and Contacts app, see:

... and:

Though the latter doesn't seem to care for the middle name either. You might want to try injecting the contacts' matching code into the SMS app and see what gives :)
I didn't really check how the Contacts app works these days, but in the past it was iterating all the contacts in JS, which is something I'd like to avoid in the SMS app.

So that means we need to evolve the mozContacts API. It's written in JavaScript so you can have a look, but since it's in Gecko it's more involved to build and write tests.
Component: Gaia::SMS → DOM: Contacts
Product: Firefox OS → Core
AxelR, if you're still interested in fixing the bug, you'll have to look at ContactDB, specifically the makeImport method:

It's not the prettiest code, but the fix should be simple, we need to split givenName/familyName/name properties and add the individual words to the index.

Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.
Priority: -- → P5
DOM: Contacts isn't used anymore. 
Closing all remaining bugs.
Closed: Last year
Resolution: --- → WONTFIX
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.