Last Comment Bug 779147 - Can't spawn conversation in new chat tab from message header or address book if other conversations in progress
: Can't spawn conversation in new chat tab from message header or address book ...
Status: RESOLVED FIXED
:
Product: Thunderbird
Classification: Client Software
Component: Instant Messaging (show other bugs)
: 15 Branch
: x86 All
: -- normal (vote)
: Thunderbird 17.0
Assigned To: Mike Conley (:mconley) - (Needinfo me!)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-31 08:30 PDT by Mike Conley (:mconley) - (Needinfo me!)
Modified: 2012-08-03 06:58 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
+
fixed
+
fixed


Attachments
Patch v1 (2.29 KB, patch)
2012-08-01 09:45 PDT, Mike Conley (:mconley) - (Needinfo me!)
florian: review+
standard8: approval‑comm‑aurora+
standard8: approval‑comm‑beta+
Details | Diff | Splinter Review

Description Mike Conley (:mconley) - (Needinfo me!) 2012-07-31 08:30:33 PDT
STR:

1)  Open an IM conversation with one or more contacts
2)  Close the chat tab
3)  In a message header that is showing presence for one of your chat contacts (that was not part of the conversations in part 1), click on the indicator to open up a conversation with that user.

What happens?

The chat tab is opened and focused, but no conversation for the selected user appears. What's more, manually opening a conversation with the contact from part 3 is now impossible, and throws the following error:

JavaScript error: chrome://messenger/content/chat/chat-messenger-overlay.js, line 457: conv is undefined.

What's expected?

The conversations should open properly with the selected contact.


I believe this is related to the code in openTab for the chat tab, which only appears to call _addConversation for the UI Conversations iff the element after conversationsGroup is searchResultConv.
Comment 1 Mike Conley (:mconley) - (Needinfo me!) 2012-07-31 12:30:50 PDT
Florian:

Why do we only call _addConversation in the chat tab openTab function when conversationsGroup is next to searchResultConv?

http://mxr.mozilla.org/comm-central/source/mail/components/im/content/chat-messenger-overlay.js#107

-Mike
Comment 2 Florian Quèze [:florian] [:flo] 2012-07-31 16:24:28 PDT
(In reply to Mike Conley (:mconley) from comment #1)
> Florian:
> 
> Why do we only call _addConversation in the chat tab openTab function when
> conversationsGroup is next to searchResultConv?
> 
> http://mxr.mozilla.org/comm-central/source/mail/components/im/content/chat-
> messenger-overlay.js#107
> 
> -Mike

That code (lines 108-116) builds the displayed list of conversations the first time the chat tab is opened. "conversationsGroup is next to searchResultConv" is a way to test that the list of displayed conversations is currently empty.

After that, new conversations are added when the new-ui-conversation notification is received. The bug here is because when receiving new-ui-conversation we test gChatTab as a way to know if the chat tab is opened, but we should instead test if it has ever been opened, or something like that.
Comment 3 Mike Conley (:mconley) - (Needinfo me!) 2012-08-01 09:45:16 PDT
Created attachment 647997 [details] [diff] [review]
Patch v1

Something like this?
Comment 4 Florian Quèze [:florian] [:flo] 2012-08-01 09:57:03 PDT
Comment on attachment 647997 [details] [diff] [review]
Patch v1

This patch is ok with me if it fixes the issue (I'm assuming again that you have verified it does ;)).
Comment 5 Mike Conley (:mconley) - (Needinfo me!) 2012-08-01 10:17:32 PDT
comm-central: https://hg.mozilla.org/comm-central/rev/c31a57d9fdfc
Comment 6 Mike Conley (:mconley) - (Needinfo me!) 2012-08-03 06:58:09 PDT
comm-aurora: https://hg.mozilla.org/releases/comm-aurora/rev/60d11d425271
comm-beta: https://hg.mozilla.org/releases/comm-beta/rev/a4b3e0cbff5d

Note You need to log in before you can comment on or make changes to this bug.