Closed Bug 981327 Opened 10 years ago Closed 10 years ago

[JavaScript Error: 'TypeError: item is undefined' {file: app://communications.gaiamobile.org/shared/js/binary_search.js line: 26}]

Categories

(Firefox OS Graveyard :: Gaia::Dialer, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: vingtetun, Unassigned, NeedInfo)

References

Details

Attachments

(1 file, 1 obsolete file)

I don't have Facebook contacts on my phone and this error keeps popping up when I'm typing a phone number in the dialer keypad. It seems like treeTel is an |object| instead of an |array| and the binarySearch utils complains.

I can't find in the codebase where treeTel is define as an object, so I wonder if that's a leftover from an old facebook datastore ?

In all cases the above patch prevent the errors to be generated while I believe it does not break anything since my understanding is that the index is generated just to make the code not generate errors.
OS: Linux → All
Hardware: x86_64 → All
Comment on attachment 8388106 [details] [diff] [review]
bug981327.patch

the proposed patch will always reset the index so it is not the correct solution. Attached is proposed a different solution. Vivien, please check that my proposal fixes the problem for you
Attachment #8388106 - Flags: review?(jmcf) → review-
Attached file 17020.html
Attachment #8388106 - Attachment is obsolete: true
Attachment #8388428 - Flags: review?(21)
Comment on attachment 8388428 [details]
17020.html

I didn't tried it locally but looking at the code I'm pretty sure it solve the issue for me, since it is really related to treeTel beeing an object.
Attachment #8388428 - Flags: review?(21) → review+
landed in master:

https://github.com/mozilla-b2g/gaia/commit/2ac4603e3269c5d410869a76c13a25bdb6a79241
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Depends on: 982150
Sorry guys, I had to back this out for causing regressing bug 982150. Not sure why the SMS tests didn't catch this in the first place, but would be good to add a test that would catch it before re-landing.

https://github.com/mozilla-b2g/gaia/commit/2dd9e509aeec0cb01bee17f42494b0a501128792
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
The main issue here is not really the SMS tests, but it's that this piece of code was r+ without tests ;) And that a perfectly expected situation like "result=null" was not tested in existing tests either.

Please add a test for at least this situation before relanding.
Is this still an issue? I haven't seen this recently.
Flags: needinfo?(21)
Assuming that this is fixed given the lack of response and recent reports.
Status: REOPENED → RESOLVED
Closed: 10 years ago10 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: