Closed Bug 963071 Opened 10 years ago Closed 9 years ago

[Messages] thread is undefined when clicking a notification and the app is not launched

Categories

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

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(tracking-b2g:backlog, b2g-master unaffected)

RESOLVED WORKSFORME
tracking-b2g backlog
Tracking Status
b2g-master --- unaffected

People

(Reporter: julienw, Unassigned)

References

Details

Attachments

(1 obsolete file)

STR:
* send a SMS to your device
* kill the Messages app _after_ you receive the notification
* tap the notification

Then we see this in the log:

01-23 14:35:50.490 10107 10107 E GeckoConsole: [JavaScript Error: "TypeError: thread is undefined" {file: "app://sms.gaiamobile.org/js/message_manager.js" line: 326}]

The only user impact is that an existing draft won't be loaded.
OS: Linux → Gonk (Firefox OS)
Hardware: x86_64 → ARM
Assignee: nobody → evelyn
Summary: [Messages] thread is undefined when clicking a notification and the app is not launched → [Messages][Drafts] thread is undefined when clicking a notification and the app is not launched
My initial guess is this happens because ThreadListUI.renderThreads() (which loads threads) is not called when the app goes straight to a thread
Not really a drafts issue, but threads and drafts definitely need to be loaded by the time that line in MessageManager is reached, and that is not happening in these STR
Summary: [Messages][Drafts] thread is undefined when clicking a notification and the app is not launched → [Messages] thread is undefined when clicking a notification and the app is not launched
Hi Julien,

I am NI'ing you on this to see if you want to continue the discussion here.

I think this bug happens because threads and drafts are not fully loaded by the time this code runs.
My instinct tells me this code doesn't go through the normal startup code that the app usually does, and so maybe we aren't waiting for things to load.  But I may be wrong about this.

I am going to take myself off this ticket and assign it to nobody.  But I'm happy to keep discussing here through comments, or in IRC if that's easier.

Ev
Flags: needinfo?(felash)
Assignee: evelyn → nobody
Yep I agree with the guessing :)

I think we enter the thread view when the drafts are not loaded yet, so maybe we should simply load the drafts here.
Flags: needinfo?(felash)
(In reply to Julien Wajsberg [:julienw] from comment #4)
> Yep I agree with the guessing :)
> 
> I think we enter the thread view when the drafts are not loaded yet, so
> maybe we should simply load the drafts here.

Oh, it would be too bad to lose that nice flow in the way things are loaded now.
Attachment #8374854 - Flags: review?(felash) → review-
Comment on attachment 8374854 [details] [review]
Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/16215

Oups wrong bug, sorry for that :-(
Attachment #8374854 - Attachment is obsolete: true
comms triage: issue pending to be fixed in draft, not blocking v1.4, ask for approval when ready. In case not able to have it in v1.4. it should be fixed in v1.5
blocking-b2g: 1.4? → 1.5?
to backlog
blocking-b2g: 1.5? → backlog
blocking-b2g: backlog → ---
qawanted to check if this still happens on master.
Keywords: qawanted
The code is now in thread_ui.js but it doesn't seem to have changed much so we could still have the issue.
I was not able to reproduce the issue following the steps. I did not see that particular Javascript error in the log.

Tested on:
Device: Flame 3.0 Master (full flashed 319MB KK)
BuildID: 20150420010204
Gaia: cb41d8421da5dc4f16ea566ea2917a9b7f828154
Gecko: 50b95032152c
Gonk: b83fc73de7b64594cd74b33e498bf08332b5d87b
Version: 40.0a1 (3.0 Master)
Firmware Version: v18D-1
User Agent: Mozilla/5.0 (Mobile; rv:40.0) Gecko/40.0 Firefox/40.0

----

I did notice something different and wonder if it's a bug: If I'm in Messages main page or just anywhere in Messages (in a particular thread), then I do NOT receive a notification when I receive an SMS. The SMS is silently updated to the thread and it does not inform me at all (other than the blue dot indicating new message in front of the thread on thread view).
QA Whiteboard: [QAnalyst-Triage?]
Flags: needinfo?(ktucker)
Keywords: qawanted
(In reply to Pi Wei Cheng [:piwei] from comment #12)
> 
> I did notice something different and wonder if it's a bug: If I'm in
> Messages main page or just anywhere in Messages (in a particular thread),
> then I do NOT receive a notification when I receive an SMS. The SMS is
> silently updated to the thread and it does not inform me at all (other than
> the blue dot indicating new message in front of the thread on thread view).

It looks like a bug, but I wasn't able to repro this on the latest master. Could you please file a bug for this with STR?

I can imagine that this could happen when sender didn't have number associated with it (see bug 1154993), but the fix for it has just landed on master.

Thanks!
I've filed bug 1156464 for the issue observed at comment 13.
QA Whiteboard: [QAnalyst-Triage?] → [QAnalyst-Triage+]
Flags: needinfo?(ktucker)
Based on comment 12
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: