Closed Bug 955925 Opened 9 years ago Closed 9 years ago

[Messages] Threads cannot be opened when retrieving the corresponding contact fails

Categories

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

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gsvelto, Assigned: gsvelto)

References

Details

Attachments

(2 files, 1 obsolete file)

+++ This bug was initially created as a clone of Bug #907740 +++

Bug 907740 introduced an issue whereas if navigator.mozContacts.find() fails and invokes the onerror() path then findByPhoneNumber() will trigger an error as it doesn't verify if the |results| argument is defined before accessing it.

STR, start with a freshly flashed phone:

1. Install thje light reference workload
   make reference-workload-light APP=sms
2. Open the SMS app
3. Try tapping on the large SMS thread, the thread won't open and an error will be logged in the logcat
Assignee: nobody → gsvelto
Status: NEW → ASSIGNED
Attachment #8355080 - Flags: review?(felash)
I suspect this is actually a duplicate of bug 952781, since thread rendering with or without a stored contact worked just fine prior to the patch that caused that bug.
Summary: Threads cannot be opened when retrieving the corresponding contact fails → [Messages] Threads cannot be opened when retrieving the corresponding contact fails
Duplicate of this bug: 952781
Duplicate of this bug: 955978
Duplicate of this bug: 953271
Comment on attachment 8355080 [details] [diff] [review]
[PATCH] Properly handle the result of a failed contact retrieval operation

r=me

can you try to do a unit test before landing? Should be reasonnably easy, I'm sure we already have a test with an onerror call.
Attachment #8355080 - Flags: review?(felash) → review+
Now with unit-test attached :)

(the way I trigger the error is not exactly pretty but I could not find a cleaner way with the existing mock)
Attachment #8355080 - Attachment is obsolete: true
Attachment #8356113 - Flags: review?(felash)
Julien, this looks good to me
Attachment #8356113 - Flags: review?(felash) → review?(waldron.rick)
Comment on attachment 8356113 [details] [diff] [review]
[PATCH v2] Properly handle the result of a failed contact retrieval operation

Thanks for addressing this issue!

r=me
Attachment #8356113 - Flags: review?(waldron.rick) → review+
Thanks for the review, Travis is green:

https://travis-ci.org/mozilla-b2g/gaia/builds/16468626

Pushed to gaia/master b0442b2867a78f30e26cee23aba4de3edbb9e86a
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
My r+ was already given in comment 7 ;)
Duplicate of this bug: 956062
You need to log in before you can comment on or make changes to this bug.