[Contacts API] Error in finding matching contacts for international number (00)

RESOLVED FIXED in Firefox 26, Firefox OS v1.2

Status

()

Core
DOM: Device Interfaces
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: gtorodelvalle, Assigned: gwagner)

Tracking

unspecified
1.2 C3(Oct25)
x86
Gonk (Firefox OS)
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(blocking-b2g:koi+, firefox25 wontfix, firefox26 fixed, firefox27 fixed, b2g-v1.2 fixed)

Details

Attachments

(1 attachment)

3.95 KB, patch
Ben Turner (not reading bugmail, use the needinfo flag!)
: review+
Details | Diff | Splinter Review
navigator.mozContacts.find({filterOp: 'match', filterBy: 'tel'} ) is not retrieving as matching contacts with '00'-type international phone numbers. It is working fine for numbers with no international prefix and numbers with '+'-type international prefix.

For example, in case of 3 contacts with phone numbers 666666666, +34666666666, 0034666666666. The 666666666 and +34666666666 ones are detected as matching contacts whereas the 0034666666666 is not.
Blocks: 904515
blocking-b2g: --- → koi?
Vicamo, is Gene handling phone number normalization now (I ask because I saw him assign himself on another bug)?
Flags: needinfo?(vyang)
triage: koi+ as it blocks a v1.2 koi+ bug
blocking-b2g: koi? → koi+
(Assignee)

Comment 3

4 years ago
Created attachment 816048 [details] [diff] [review]
patch

We need a 2nd request that deals with international prefix numbers :(
Assignee: nobody → anygregor
Attachment #816048 - Flags: review?(bent.mozilla)

Updated

4 years ago
Target Milestone: --- → 1.2 C3(Oct25)
Comment on attachment 816048 [details] [diff] [review]
patch

Review of attachment 816048 [details] [diff] [review]:
-----------------------------------------------------------------

Ick. r=me with this addressed:

::: dom/contacts/fallback/ContactDB.jsm
@@ +1065,5 @@
> +        } else if (normalized[0] !== "+") {
> +          // We might have an international prefix like '00'
> +          let parsed = PhoneNumberUtils.parse(normalized);
> +          if (parsed && parsed.internationalNumber &&
> +              parsed.nationalNumber !== normalized &&

Shouldn't you check that parsed.nationalNumber exists before moving on here?
Attachment #816048 - Flags: review?(bent.mozilla) → review+
(Assignee)

Comment 5

4 years ago
https://hg.mozilla.org/integration/b2g-inbound/rev/5a492d7ab6f4
(Assignee)

Updated

4 years ago
Flags: needinfo?(vyang)
https://hg.mozilla.org/mozilla-central/rev/5a492d7ab6f4
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
(Assignee)

Comment 7

4 years ago
Can you test this again please?
Flags: needinfo?(gtorodelvalle)
Bug 904515 which depended on this one works fine now :-) Thank you very much!
Flags: needinfo?(gtorodelvalle)
https://hg.mozilla.org/releases/mozilla-aurora/rev/6c8fcc1e8f84
status-b2g-v1.2: --- → fixed
status-firefox25: --- → wontfix
status-firefox26: --- → fixed
status-firefox27: --- → fixed
You need to log in before you can comment on or make changes to this bug.