Closed Bug 905927 Opened 11 years ago Closed 11 years ago

[Contacts API] fail in matching digits test.

Categories

(Core :: DOM: Device Interfaces, defect, P2)

1.0 Branch
ARM
Gonk (Firefox OS)
defect

Tracking

()

RESOLVED FIXED
1.1 QE5
blocking-b2g leo+
Tracking Status
firefox24 --- wontfix
firefox25 --- wontfix
firefox26 --- fixed
b2g18 --- fixed
b2g18-v1.0.0 --- wontfix
b2g18-v1.0.1 --- wontfix
b2g-v1.1hd --- fixed

People

(Reporter: leo.bugzilla.gecko, Assigned: gwagner)

Details

(Whiteboard: [TD-78570][TD-78575])

Attachments

(8 files, 5 obsolete files)

12.05 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Details
57.01 KB, application/vnd.ms-excel.sheet.macroEnabled.12
Details
57.00 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Details
12.14 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Details
223.62 KB, text/plain
Details
57.26 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Details
61.41 KB, application/x-zip-compressed
Details
24.50 KB, patch
gwagner
: review+
Details | Diff | Splinter Review
No description provided.
1. Perform all the phonebook matching tests from attached files. 2. Test Place - VENEZUELA EXPECTED: The handset must makes the matching in all conditions on file attached. Should follow the rules. ACTUAL: The phone does not matching correctly.
Attached file matchingError0816.xlsm
Summary: [Contacts API] matching digits → [Contacts API] fail in matching digits test.
I tried to change the value of 'substringMatching' for Venezuela. The value of 'substringMatching' is set to '7'. I changed the value to '10'. Ex> B2g.js pref("dom.phonenumber.substringmatching.VE", 10); Fail items decreased. But, bug is still reproduced. I'll attach the test results. Please check this. In addition, Please let us know the value of "ES"(Spain).
blocking-b2g: --- → leo?
Priority: -- → P2
Whiteboard: [TD-78570][TD-78575]
Target Milestone: --- → 1.1 QE5
blocking-b2g: leo? → leo+
Hi Gregor, did you work on the phone number matching logic? Can you check if all we need is to add customisation for Venezuela or if something is broken? Thanks
Flags: needinfo?(anygregor)
Flags: needinfo?(anygregor)
Assignee: nobody → anygregor
Attached patch patch (obsolete) — Splinter Review
Attached patch patch (obsolete) — Splinter Review
Attachment #793631 - Attachment is obsolete: true
Leo, can you test with this patch?
I tested this patch to leo device. But, bug is still reproduced. I'll attach log file.
1. Save Contact (Name: Aaa Aaa, Tel: 7704143727591 2. MO call (Number: 04143727591) Result> -.EXPECTED: Match -.ACTUAL: No match
I would like to know the progress of patch work. Please check. And, I have another question. According to the test case... The same scenario, but the result should be differnt.(Depending on operators) Ex> 1. Contact:"(0426) 123-4567", MO Call:"123-4567" -> EXPECTED: TELEFONICA-NO, MOVILNET-YES 2. Contact:"(0426) 945-6771", MO Call:"945-6771" -> EXPECTED: TELEFONICA-NO, MOVILNET-YES (Yellow highlight in attached file) Is it possible to pass complete including these items? Please check as soon as possible. Thanks.
Added yellow highlight and the rest of the test results.
(In reply to leo.bugzilla.gecko from comment #13) > I would like to know the progress of patch work. > Please check. > > And, I have another question. > According to the test case... > The same scenario, but the result should be differnt.(Depending on operators) What does that mean? We need to apply the substring matching based on the operator within a certain country?
Flags: needinfo?(jaeohkim83)
(In reply to leo.bugzilla.gecko from comment #12) > Created attachment 793830 [details] > log_matchingDigits_VE_0822.txt > > 1. Save Contact > (Name: Aaa Aaa, Tel: 7704143727591 > 2. MO call > (Number: 04143727591) > > Result> > -.EXPECTED: Match > -.ACTUAL: No match Oh I see what happened here. '77' is not a valid country code and we couldn't parse it.
Attached patch patch (obsolete) — Splinter Review
Can you test with the updated patch?
Attachment #793648 - Attachment is obsolete: true
Attached patch patch (obsolete) — Splinter Review
Now with the new testfile.
(In reply to Gregor Wagner [:gwagner] from comment #18) > Created attachment 795663 [details] [diff] [review] patch Now with the new > testfile. I tested this patch. Most of the fail cases are fixed. In addition to this patch, I had set the value of substringmatching set to '10'. Right? Please confirm. And, There are some issues I mentioned above(comment #13) remain. As your question(comment #15)... "We need to apply the substring matching based on the operator within a certain country?" -> Is this possible? I'll attach test result. Check please.
(In reply to leo.bugzilla.gecko from comment #19) > (In reply to Gregor Wagner [:gwagner] from comment #18) > > Created attachment 795663 [details] [diff] [review] > patch > > Now with the new > > testfile. > > I tested this patch. > Most of the fail cases are fixed. > In addition to this patch, I had set the value of substringmatching set to > '10'. > Right? > Please confirm. > > And, There are some issues I mentioned above(comment #13) remain. > As your question(comment #15)... > "We need to apply the substring matching based on the operator within a > certain country?" > -> Is this possible? No we don't support that. But how can we fix the problem you stated in comment #13? 1. Contact:"(0426) 123-4567", MO Call:"123-4567" -> EXPECTED: TELEFONICA-NO, MOVILNET-YES They would need a separate entry of substringmatching?
(In reply to Gregor Wagner [:gwagner] from comment #21) > (In reply to leo.bugzilla.gecko from comment #19) > (In reply to Gregor > Wagner [:gwagner] from comment #18) > > Created attachment 795663 [details] [diff] [review] > [diff] [review] > patch > > Now with the new > > testfile. > > I tested > this patch. > Most of the fail cases are fixed. > In addition to this patch, > I had set the value of substringmatching set to > '10'. > Right? > Please > confirm. > > And, There are some issues I mentioned above(comment #13) > remain. > As your question(comment #15)... > "We need to apply the > substring matching based on the operator within a > certain country?" > -> > Is this possible? No we don't support that. But how can we fix the problem > you stated in comment #13? 1. Contact:"(0426) 123-4567", MO Call:"123-4567" > -> EXPECTED: TELEFONICA-NO, MOVILNET-YES They would need a separate entry > of substringmatching? The matching rules as follows: (Ref. "matchingError0816.xlsm") ---------------------------------- 1 - Search all contacts with 7 digits. (match 7 digits) 2 - Search all contacts with 11 digits and match the last 10 digits, considering the network code + number dialed of 7 digits. (Example: In Digitel Network, dialing 1234567 it would match with the contact 0412 1234567) For Movistar the prefix are 0414 and 0424 and for Movilnet are 0416 and 0426. ---------------------------------- I can't test by the network right now. But, matching contact doesn't seem to use the 'MNC' or and so on. So, I wondered if it supports it. First of all, Check my question. > In addition to this patch, I had set the value of 'substringmatching' set to > '10'. > Right? > Please confirm. Thanks.
(In reply to leo.bugzilla.gecko from comment #22) > (In reply to Gregor Wagner [:gwagner] from comment #21) > > (In reply to leo.bugzilla.gecko from comment #19) > > (In reply to Gregor > > Wagner [:gwagner] from comment #18) > > > Created attachment 795663 [details] [diff] [review] > > [diff] [review] > > patch > > > > Now with the new > > > testfile. > > > > I tested > > this patch. > > Most of the fail cases are fixed. > > In addition to this patch, > > I had set the value of substringmatching set to > > '10'. > > Right? > > Please > > confirm. > > > > And, There are some issues I mentioned above(comment #13) > > remain. > > As your question(comment #15)... > > "We need to apply the > > substring matching based on the operator within a > > certain country?" > > -> > > Is this possible? > > No we don't support that. But how can we fix the problem > > you stated in comment #13? > > 1. Contact:"(0426) 123-4567", MO Call:"123-4567" > > -> EXPECTED: TELEFONICA-NO, MOVILNET-YES > > They would need a separate entry > > of substringmatching? > > The matching rules as follows: > (Ref. "matchingError0816.xlsm") > ---------------------------------- > 1 - Search all contacts with 7 digits. (match 7 digits) > 2 - Search all contacts with 11 digits and match the last 10 digits, > considering the network code + number dialed of 7 digits. (Example: In > Digitel Network, dialing 1234567 it would match with the contact 0412 > 1234567) > For Movistar the prefix are 0414 and 0424 and for Movilnet are 0416 and 0426. > ---------------------------------- > > I can't test by the network right now. > But, matching contact doesn't seem to use the 'MNC' or and so on. > So, I wondered if it supports it. > > First of all, Check my question. > > In addition to this patch, I had set the value of 'substringmatching' set to > > '10'. > > Right? > > Please confirm. > > Thanks. No we don't support substring matching based on carrier. Lets just use the 7 digit matching and this should work 99.9% of the time. Or do people tend to have the same phone number with different prefix? So is it a common case that people have for example a 0414-1234567 and a 0416-1234567 number?
Attached patch patch (obsolete) — Splinter Review
Attachment #795661 - Attachment is obsolete: true
Attachment #795663 - Attachment is obsolete: true
Attachment #796325 - Flags: review?(bent.mozilla)
I tested this patch. What I want to know is the value of 'substringmatching' for VE. It is not included in your patch. But, test result depends on value of 'substringmatching'. The value of 'substringMatching' is set to '7'-> FAIL The value of 'substringMatching' is set to '10'-> PASS Example> -. Contact: 7414 3727591 -. Dial: 0414 3727591 -. EXPECTED: Match -. ACTUAL: The value of 'substringMatching' is set to '7'-> No match The value of 'substringMatching' is set to '10'-> Match Other cases are the same results. I want to know if I could change the value to '10'.
(In reply to leo.bugzilla.gecko from comment #25) > I tested this patch. > > What I want to know is the value of 'substringmatching' for VE. > It is not included in your patch. > But, test result depends on value of 'substringmatching'. > The value of 'substringMatching' is set to '7'-> FAIL > The value of 'substringMatching' is set to '10'-> PASS > Example> > -. Contact: 7414 3727591 > -. Dial: 0414 3727591 > -. EXPECTED: Match > -. ACTUAL: > The value of 'substringMatching' is set to '7'-> No match > The value of 'substringMatching' is set to '10'-> Match > Other cases are the same results. > I want to know if I could change the value to '10'. The value is already set to 7: http://mxr.mozilla.org/mozilla-central/source/b2g/app/b2g.js#395 How do you test this? We don't support changing the value during runtime. So it's important that you reboot the device after you change substringMatching and also delete and re-insert the contact.
I don't change the value during runtime. I just changed it in the source code. ----------------------- [b2g.js] pref("dom.phonenumber.substringmatching.VE", 7); -> pref("dom.phonenumber.substringmatching.VE", 10); -----------------------
Comment on attachment 796325 [details] [diff] [review] patch Review of attachment 796325 [details] [diff] [review]: ----------------------------------------------------------------- r=me with this stuff addressed: ::: dom/contacts/fallback/ContactDB.jsm @@ +662,5 @@ > } > } > } > for (let num in containsSearch) { > + if (num && num != "null") { Ick, can "null" really happen? @@ +1015,5 @@ > > let filter_keys = fields.slice(); > for (let key = filter_keys.shift(); key; key = filter_keys.shift()) { > let request; > + let substringResult = {}; Shouldn't this be an array? @@ +1048,5 @@ > dump("ContactDB: normalized filterValue is empty, can't perform match search.\n"); > return txn.abort(); > } > > + let substringRequest; Why is this outside the block below? You don't use it again do you? @@ +1096,5 @@ > txn.result = {}; > > request.onsuccess = function (event) { > if (DEBUG) debug("Request successful. Record count: " + event.target.result.length); > + if (substringResult && Object.keys(substringResult).length > 0) { 'substringResult' will always evaluate to true here. @@ +1097,5 @@ > > request.onsuccess = function (event) { > if (DEBUG) debug("Request successful. Record count: " + event.target.result.length); > + if (substringResult && Object.keys(substringResult).length > 0) { > + for (var attrname in substringResult) { This will make attrname '1', '2', etc, right? Also trailing whitespace. ::: dom/phonenumberutils/PhoneNumberUtils.jsm @@ +84,5 @@ > > parse: function(aNumber) { > if (DEBUG) debug("call parse: " + aNumber); > let result = PhoneNumber.Parse(aNumber, this.getCountryName()); > + Nit: whitespace @@ +111,2 @@ > } > + } else { else if (DEBUG)
Attachment #796325 - Flags: review?(bent.mozilla) → review+
(In reply to Gregor Wagner [:gwagner] from comment #26) > (In reply to leo.bugzilla.gecko from comment #25) > > I tested this patch. > > > > What I want to know is the value of 'substringmatching' for VE. > > It is not included in your patch. > > But, test result depends on value of 'substringmatching'. > > The value of 'substringMatching' is set to '7'-> FAIL > > The value of 'substringMatching' is set to '10'-> PASS > > Example> > > -. Contact: 7414 3727591 > > -. Dial: 0414 3727591 > > -. EXPECTED: Match > > -. ACTUAL: > > The value of 'substringMatching' is set to '7'-> No match > > The value of 'substringMatching' is set to '10'-> Match > > Other cases are the same results. > > I want to know if I could change the value to '10'. > > The value is already set to 7: > http://mxr.mozilla.org/mozilla-central/source/b2g/app/b2g.js#395 > > How do you test this? > We don't support changing the value during runtime. So it's important that > you reboot the device after you change substringMatching and also delete and > re-insert the contact. Is 7414 3727591 a valid number in VE? '7' is the country code for Russia and we interpret it as a Russian number.
(In reply to ben turner [:bent] (needinfo? encouraged) from comment #28) > Comment on attachment 796325 [details] [diff] [review] > patch > > Review of attachment 796325 [details] [diff] [review]: > ----------------------------------------------------------------- > > r=me with this stuff addressed: > > ::: dom/contacts/fallback/ContactDB.jsm > @@ +662,5 @@ > > } > > } > > } > > for (let num in containsSearch) { > > + if (num && num != "null") { > > Ick, can "null" really happen? > Yes :( > @@ +1015,5 @@ > > > > let filter_keys = fields.slice(); > > for (let key = filter_keys.shift(); key; key = filter_keys.shift()) { > > let request; > > + let substringResult = {}; > > Shouldn't this be an array? No we use it as a dictionary. > > @@ +1048,5 @@ > > dump("ContactDB: normalized filterValue is empty, can't perform match search.\n"); > > return txn.abort(); > > } > > > > + let substringRequest; > > Why is this outside the block below? You don't use it again do you? fixed > > @@ +1096,5 @@ > > txn.result = {}; > > > > request.onsuccess = function (event) { > > if (DEBUG) debug("Request successful. Record count: " + event.target.result.length); > > + if (substringResult && Object.keys(substringResult).length > 0) { > > 'substringResult' will always evaluate to true here. fixed > > @@ +1097,5 @@ > > > > request.onsuccess = function (event) { > > if (DEBUG) debug("Request successful. Record count: " + event.target.result.length); > > + if (substringResult && Object.keys(substringResult).length > 0) { > > + for (var attrname in substringResult) { > > This will make attrname '1', '2', etc, right? fixed > > Also trailing whitespace. my trademark... > > ::: dom/phonenumberutils/PhoneNumberUtils.jsm > @@ +84,5 @@ > > > > parse: function(aNumber) { > > if (DEBUG) debug("call parse: " + aNumber); > > let result = PhoneNumber.Parse(aNumber, this.getCountryName()); > > + > > Nit: whitespace > > @@ +111,2 @@ > > } > > + } else { > > else if (DEBUG) fixed.
Attached patch final patchSplinter Review
Attachment #796325 - Attachment is obsolete: true
Attachment #796877 - Flags: review+
Status: NEW → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Needs a branch-specific patch for uplift.
leo has to take this patch. Please uplift to b2g18. Thank you.
Flags: needinfo?(jaeohkim83)
(In reply to jongsoo.oh from comment #35) > leo has to take this patch. > Please uplift to b2g18. Thank you. The patch landed on b2g18. Please test it from your side again.
Flags: needinfo?(jaeohkim83)
I tested the patch. This issue is fixed. But, The following was deleted. ----------------------------------------------------------------------------- --- a/dom/contacts/fallback/ContactDB.jsm +++ b/dom/contacts/fallback/ContactDB.jsm @@ -982,17 +983,27 @@ ContactDB.prototype = { } let index = store.index("telMatch"); let normalized = PhoneNumberUtils.normalize(options.filterValue, /*numbersOnly*/ true); + if (!normalized.length) { + dump("ContactDB: normalized filterValue is empty, can't perform match search.\n"); + return txn.abort(); + } // Some countries need special handling for number matching. Bug 877302 if (this.substringMatching && normalized.length > this.substringMatching) { ----------------------------------------------------------------------------- Is that right? Please confirm.
Flags: needinfo?(jaeohkim83)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: