Bug 39172

Summary: TpTextChannel never finishes preparing if there are pending messages with no message-sender-id
Product: Telepathy Reporter: Will Thompson <will>
Component: tp-glibAssignee: Telepathy bugs list <telepathy-bugs>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium Keywords: patch
Version: git master   
Hardware: Other   
OS: All   
URL: http://cgit.collabora.com/git/user/wjt/telepathy-glib.git/log/?h=fd.o-39172-TpTextChannel-pending-message-queue
Whiteboard:
i915 platform: i915 features:

Description Will Thompson 2011-07-12 07:26:04 UTC
Since telepathy-glib 0.15.0, if a CM does not include message-sender-id in received messages, preparing a TpTextChannel for a proxy which has pending messages will never complete.

This is due to http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=6fe8293 (which I advocated). The only reference to 'result' is owned by the call to Get(..., 'PendingMessages'), which is released once get_pending_messages_cb() returns. So the callback for tp_connection_get_contacts_by_handle / tp_connection_get_contacts_by_id never fires, because 'result' is specified as the weak object for the call.

A possible fix is to take a reference on 'result' so that it does not die. This would be equivalent to how this code worked before.

There's a second bug in that commit: g_async_result_get_source_object() returns a new ref, not a borrowed ref, and the refs are never released.

This was originally reported against Empathy: <https://bugzilla.gnome.org/show_bug.cgi?id=654447>
Comment 1 Will Thompson 2011-07-12 08:23:14 UTC
Here's a branch. Phew!
Comment 2 Will Thompson 2011-07-12 09:13:00 UTC
Reviewed by Jonny and released in 0.15.4.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.