Closed Bug 865164 Opened 11 years ago Closed 11 years ago

The SMS app contact lookup doesn't support spaces in phone numbers

Categories

(Core :: DOM: Device Interfaces, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 866135
blocking-b2g leo+

People

(Reporter: etienne, Unassigned)

References

Details

STR:
- import a contact (from gmail or other) with spaces between digits
- open the SMS app
- create a new message
- use the auto complete feature to find the imported contact
- select it

EXPECTED:
- the name of the contact should appear in the header

ACTUAL:
- we see the number instead (like when no contact matches)

ADDITIONAL:
- editing the contact and removing the spaces from the phone number makes the lookup work again

Note: since we cannot modify Facebook contacts infos we cannot sanitize the numbers on import, we should just handle format characters in the phone numbers properly.
The main question is : how should we do that ?

I don't exactly know how Facebook contacts work: are they searchable from the Contacts API ?

If yes, I'm quite sure the Contacts API should handle this properly, ie index the number without spaces, and search without spaces. Maybe use the PhoneNumberUtils library to convert whatever is used to a "canonical" number.
Component: Gaia::SMS → DOM: Device Interfaces
Product: Boot2Gecko → Core
blocking-b2g: --- → leo?
(In reply to Julien Wajsberg [:julienw] from comment #1)
> The main question is : how should we do that ?
> 
> I don't exactly know how Facebook contacts work: are they searchable from
> the Contacts API ?

This is a very good point, they are not.

So either we sanitize phone numbers (from the gmail/hotmail import) while importing them in the contacts database or we sanitize in the sms app (the dialer is already handling this correctly).

I'm completely fine with both.
(In reply to Etienne Segonzac (:etienne) from comment #2)
> I'm completely fine with both.

Note that this might be a UX question since I can imagine phone number formatting being more or less of an issue depending on the country.
We worked hard in the Sms app to _not_ do any sanitization ourselves, and instead have it handled by the gecko Sms API. So I'd really favor having this done in the Contacts API but I'll be fine if that's done at importing time.

Gregor, could this be done in the Contacts API ?
Flags: needinfo?(anygregor)
Triage 4/29 -
Apart from not matching and showing the contact name correctly, are there any impacts to functions such as unable to send sms to imported numbers containing spaces?

Also adding UX and product to decide if this is a required feature for 1.1.
Flags: needinfo?(jcarpenter)
Flags: needinfo?(ffos-product)
Flags: needinfo?(etienne)
(In reply to Julien Wajsberg [:julienw] from comment #4)
> We worked hard in the Sms app to _not_ do any sanitization ourselves, and
> instead have it handled by the gecko Sms API. So I'd really favor having
> this done in the Contacts API but I'll be fine if that's done at importing
> time.
> 
> Gregor, could this be done in the Contacts API ?

Already fixed. We have to uplift bug 866135.
Flags: needinfo?(anygregor)
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
(In reply to Wayne Chang [:wchang] from comment #5)
> Triage 4/29 -
> Apart from not matching and showing the contact name correctly, are there
> any impacts to functions such as unable to send sms to imported numbers
> containing spaces?

It breaks the threading too.
Flags: needinfo?(etienne)
blocking-b2g: leo? → -
blocking-b2g: - → leo+
Flags: needinfo?(ffos-product)
Flags: needinfo?(jcarpenter)
You need to log in before you can comment on or make changes to this bug.