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

RESOLVED FIXED in Firefox 21

Status

Firefox OS
General
P1
normal
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: scravag, Assigned: etienne)

Tracking

unspecified
B2G C4 (2jan on)
ARM
Gonk (Firefox OS)

Firefox Tracking Flags

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

Details

Attachments

(1 attachment, 5 obsolete attachments)

(Reporter)

Description

5 years ago
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.
(Reporter)

Updated

5 years ago
blocking-basecamp: --- → ?
(Reporter)

Updated

5 years ago
blocking-basecamp: ? → +
Priority: -- → P1
Target Milestone: --- → B2G C4 (2jan on)
(Assignee)

Updated

5 years ago
Assignee: nobody → etienne
(Assignee)

Comment 1

5 years ago
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 :)
(Assignee)

Comment 2

5 years ago
Created attachment 698908 [details] [diff] [review]
Patch proposal - fixing the contact db tel searh indexes
Attachment #698908 - Flags: review?(anygregor)
(Assignee)

Comment 3

5 years ago
Created attachment 698914 [details] [diff] [review]
Patch proposal - fixing the contact db tel search indexes
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)
(Assignee)

Comment 5

5 years ago
(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...
(Assignee)

Comment 6

5 years ago
Created attachment 699034 [details] [diff] [review]
Patch v2

New version after talking with Gregor rebuilding just the right index.
Attachment #698914 - Attachment is obsolete: true
Attachment #699034 - Flags: review?(anygregor)
Component: Gaia::Dialer → General
(Assignee)

Comment 7

5 years ago
Gregor pointer a new issue to me, adding a test right now...
(Assignee)

Comment 8

5 years ago
Created attachment 699335 [details] [diff] [review]
Patch v3

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+
(Assignee)

Comment 10

5 years ago
Created attachment 699627 [details] [diff] [review]
Patch v4

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+
(Assignee)

Comment 12

5 years ago
Created attachment 699657 [details] [diff] [review]
Patch v5

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+
(Assignee)

Updated

5 years ago
Keywords: checkin-needed
https://hg.mozilla.org/releases/mozilla-b2g18/rev/1e07f2621fb5
status-b2g18: --- → fixed
status-firefox19: --- → wontfix
status-firefox20: --- → wontfix
Marking FIXED as this is landed on inbound and b2g18.
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
status-firefox21: --- → fixed
You need to log in before you can comment on or make changes to this bug.