Closed Bug 924378 Opened 11 years ago Closed 11 years ago

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

Categories

(Core :: DOM: Device Interfaces, defect)

x86
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
1.2 C3(Oct25)
blocking-b2g koi+
Tracking Status
firefox25 --- wontfix
firefox26 --- fixed
firefox27 --- fixed
b2g-v1.2 --- fixed

People

(Reporter: gtorodelvalle, Assigned: gwagner)

References

Details

Attachments

(1 file)

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+
Attached patch patchSplinter Review
We need a 2nd request that deals with international prefix numbers :(
Assignee: nobody → anygregor
Attachment #816048 - Flags: review?(bent.mozilla)
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+
Flags: needinfo?(vyang)
https://hg.mozilla.org/mozilla-central/rev/5a492d7ab6f4
Status: NEW → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
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)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: