Closed Bug 900480 Opened 11 years ago Closed 11 years ago

mozContacts.find with filter 'match' provides disparate results with different SIM cards

Categories

(Core :: DOM: Device Interfaces, defect)

Other
Gonk (Firefox OS)
defect
Not set
major

Tracking

()

RESOLVED WORKSFORME
blocking-b2g koi+

People

(Reporter: jmcf, Assigned: julienw)

References

Details

(Whiteboard: [u=commsapps-user c=dialer p=3 s=v1.2-features-sprint-4])

Attachments

(1 file)

import the attached vcard file as contacts on your device. execute navigator.mozContacts.find({ filterBy: 'tel', filterOp: 'match' filterValue: '' }); with no SIM attached on the device or with a Spanish SIM. --> There is one result. : OK execute the same API call with a Vivo's SIM --> there are no results. : KO
Blocks: 894872
blocking-b2g: --- → koi?
Attached file vcard_sergi.vcf
attachment with test contacts
(In reply to Jose M. Cantera from comment #0) > import the attached vcard file as contacts on your device. > > execute navigator.mozContacts.find({ > filterBy: 'tel', > filterOp: 'match' > filterValue: '+3434269362248' > }); > > with no SIM attached on the device or with a Spanish SIM. > > --> There is one result. : OK > > execute the same API call with a Vivo's SIM > > --> there are no results. : KO
Component: General → DOM: Device Interfaces
Product: Boot2Gecko → Core
Version: unspecified → Trunk
(In reply to Jose M. Cantera from comment #0) > import the attached vcard file as contacts on your device. > > execute navigator.mozContacts.find({ > filterBy: 'tel', > filterOp: 'match' > filterValue: '' > }); > > with no SIM attached on the device or with a Spanish SIM. > > --> There is one result. : OK > > execute the same API call with a Vivo's SIM > > --> there are no results. : KO The vivo sim is from Brazil?
NI? myself so I don't forget to check this.
Flags: needinfo?(reuben.bmo)
(In reply to Gregor Wagner [:gwagner] from comment #3) > (In reply to Jose M. Cantera from comment #0) > > import the attached vcard file as contacts on your device. > > > > execute navigator.mozContacts.find({ > > filterBy: 'tel', > > filterOp: 'match' > > filterValue: '' > > }); > > > > with no SIM attached on the device or with a Spanish SIM. > > > > --> There is one result. : OK > > > > execute the same API call with a Vivo's SIM > > > > --> there are no results. : KO > > The vivo sim is from Brazil? Yes
Jose, can you tell us which Gecko version you're using ? Several lookup problems have been fixed recently.
(In reply to Julien Wajsberg [:julienw] from comment #6) > Jose, can you tell us which Gecko version you're using ? Several lookup > problems have been fixed recently. d9a90f1
Whiteboard: [u=commsapps-user c=dialer p=0]
Reproduced with a Vivo SIM card. Same problem will happen for any SIM card with an MMC that has substring matching enabled. We save data in the ContactDB indexes that changes based on the SIM card, so to fix this we would need to go through all contacts and update their indexes when we detect a SIM card change.
Flags: needinfo?(reuben.bmo)
blocking-b2g: koi? → koi+
(In reply to Reuben Morais [:reuben] from comment #8) > Reproduced with a Vivo SIM card. Same problem will happen for any SIM card > with an MMC that has substring matching enabled. We save data in the > ContactDB indexes that changes based on the SIM card, so to fix this we > would need to go through all contacts and update their indexes when we > detect a SIM card change. do we really want to do this ? The substring count is currently defined as a pref, but does it really change or can we assume that substring matching is always done with 7 characters ? If we can assume this, then it's way easier: always store the substring match in the index, but chose if we should use this as a filter value depending on the sim card. Would that work ?
(In reply to Julien Wajsberg [:julienw] from comment #9) > (In reply to Reuben Morais [:reuben] from comment #8) > > Reproduced with a Vivo SIM card. Same problem will happen for any SIM card > > with an MMC that has substring matching enabled. We save data in the > > ContactDB indexes that changes based on the SIM card, so to fix this we > > would need to go through all contacts and update their indexes when we > > detect a SIM card change. > > do we really want to do this ? > > The substring count is currently defined as a pref, but does it really > change or can we assume that substring matching is always done with 7 > characters ? Right now we have 8 for Brazil, 10 for Colombia and 7 for Venezuela… So I'm going to say we can't :)
:( Then maybe we can store all these possible substring match in the index, like we already do for the iterative search. It will make the index quite big but at least we will always have the same index no matter the SIM card. Or maybe it's possible to do a range like [1] ? [1] https://mxr.mozilla.org/mozilla-central/source/dom/contacts/fallback/ContactDB.jsm#1079
ok taking it, I hope do be able to do this during this sprint.
Assignee: nobody → felash
Whiteboard: [u=commsapps-user c=dialer p=0] → [u=commsapps-user c=dialer p=3]
(In reply to Julien Wajsberg [:julienw] from comment #11) > Then maybe we can store all these possible substring match in the index, > like we already do for the iterative search. It will make the index quite > big but at least we will always have the same index no matter the SIM card. You'd have to store them in several different indexes, but yes, that's a possibility if we're willing to live with the extra workload.
Whiteboard: [u=commsapps-user c=dialer p=3] → [u=commsapps-user c=dialer p=3 s=v1.2-features-sprint-3]
Whiteboard: [u=commsapps-user c=dialer p=3 s=v1.2-features-sprint-3] → [u=commsapps-user c=dialer p=3 s=v1.2-features-sprint-4]
This should be a dup of bug 877302. Can you test again?
Sorry it should be bug 905927.
Hi, Cannot reproduce this bug with unagi master build: ecko-fe76476 Gaia-cfcea74 Changing status to WFM
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: