Closed Bug 827321 Opened 12 years ago Closed 11 years ago

[Dialer] Can't call an emergency number when there is an existing contact with a phone number ends like the emergency number

Categories

(Firefox OS Graveyard :: General, defect, P1)

ARM
Gonk (Firefox OS)
defect

Tracking

(blocking-basecamp:+, firefox19 wontfix, firefox20 wontfix, firefox21 fixed, b2g18 fixed)

RESOLVED FIXED
B2G C4 (2jan on)
blocking-basecamp +
Tracking Status
firefox19 --- wontfix
firefox20 --- wontfix
firefox21 --- fixed
b2g18 --- fixed

People

(Reporter: dscravaglieri, Assigned: etienne)

Details

Attachments

(1 file, 5 obsolete files)

STR

Goal: Trying to call the emergency phone number 112

1 - Create a fake contact with a phone number that ends with 112 (ie: +33655555112)
2 - Open Dialer type emergency phone call 112

Expected:
The emergency phone number 112 is called

Actual:
The Contact is called.
blocking-basecamp: --- → ?
blocking-basecamp: ? → +
Priority: -- → P1
Target Milestone: --- → B2G C4 (2jan on)
Assignee: nobody → etienne
For anybody playing with this bug, *beware*:

You are actually calling *112* (the real one), the Dialer app doesn't show the right contact, but you are definitively calling the emergency number, so don't stay on the line :)
Attachment #698908 - Flags: review?(anygregor)
Attachment #698908 - Attachment is obsolete: true
Attachment #698908 - Flags: review?(anygregor)
Attachment #698914 - Flags: review?(anygregor)
Comment on attachment 698914 [details] [diff] [review]
Patch proposal - fixing the contact db tel search indexes

No that's not the right solution. Adding a new contact with the same number would result in the same situation.
Attachment #698914 - Flags: review?(anygregor)
(In reply to Gregor Wagner [:gwagner] from comment #4)
> Comment on attachment 698914 [details] [diff] [review]
> Patch proposal - fixing the contact db tel search indexes
> 
> No that's not the right solution. Adding a new contact with the same number
> would result in the same situation.

Adding a new contact didn't brought back the issue here...
Attached patch Patch v2 (obsolete) — Splinter Review
New version after talking with Gregor rebuilding just the right index.
Attachment #698914 - Attachment is obsolete: true
Attachment #699034 - Flags: review?(anygregor)
Gregor pointer a new issue to me, adding a test right now...
Attached patch Patch v3 (obsolete) — Splinter Review
Brand new index, new test, DB migration (working wonderfully)... thanks for all the pointers Gregor!
Attachment #699034 - Attachment is obsolete: true
Attachment #699034 - Flags: review?(anygregor)
Attachment #699335 - Flags: review?(anygregor)
Comment on attachment 699335 [details] [diff] [review]
Patch v3

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

Looks good to me. Ship it!
bent should check the upgrade code as well.

::: dom/contacts/fallback/ContactDB.jsm
@@ +55,5 @@
>  
>          // Properties indexes
>          objectStore.createIndex("nickname",   "properties.nickname",   { unique: false, multiEntry: true });
>          objectStore.createIndex("name",       "properties.name",       { unique: false, multiEntry: true });
> +        objectStore.createIndex("tel",        "search.exactTel",       { unique: false, multiEntry: true });

This shouldn't be needed. Please remove.
Attachment #699335 - Flags: review?(anygregor) → review+
Attached patch Patch v4 (obsolete) — Splinter Review
Added the last comment and tested the SIM contact import, no problem.
Attachment #699335 - Attachment is obsolete: true
Attachment #699627 - Flags: review?(anygregor)
Attachment #699627 - Flags: feedback?(bent.mozilla)
Comment on attachment 699335 [details] [diff] [review]
Patch v3

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

::: dom/contacts/fallback/ContactDB.jsm
@@ -59,3 @@
>          objectStore.createIndex("familyName", "properties.familyName", { unique: false, multiEntry: true });
>          objectStore.createIndex("givenName",  "properties.givenName",  { unique: false, multiEntry: true });
> -        objectStore.createIndex("tel",        "properties.tel",        { unique: false, multiEntry: true });

You should still delete this line here.

@@ +210,5 @@
> +
> +                  cursor.value.search.exactTel = [number];
> +                  if (parsedNumber &&
> +                      parsedNumber.internationalNumber &&
> +                      (number !== parsedNumber.internationalNumber)) {

Nit: These extra () aren't needed.

@@ +223,5 @@
> +          }
> +        };
> +
> +        // Delete old tel index (not on the right field).
> +        objectStore.deleteIndex("tel");

This might fail if this is the first time you're creating the database. Check |objectStore.indexNames.contains("tel")| before you do this deleteIndex.

@@ +226,5 @@
> +        // Delete old tel index (not on the right field).
> +        objectStore.deleteIndex("tel");
> +
> +        // Create new index for "equals" searches
> +        objectStore.createIndex("tel", "search.exactTel", { unique: false, multiEntry: true });

Let's do this (and the delete above) before you do the cursor stuff (it might be slightly faster).
Attachment #699335 - Attachment is obsolete: false
Attachment #699335 - Flags: review+
Attached patch Patch v5Splinter Review
Updated patch with upgrade script fine tuning.
Attachment #699335 - Attachment is obsolete: true
Attachment #699627 - Attachment is obsolete: true
Attachment #699627 - Flags: review?(anygregor)
Attachment #699627 - Flags: feedback?(bent.mozilla)
Attachment #699657 - Flags: review?(anygregor)
Attachment #699657 - Flags: review?(anygregor) → review+
Keywords: checkin-needed
Marking FIXED as this is landed on inbound and b2g18.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: