Bug 39172 - TpTextChannel never finishes preparing if there are pending messages with no message-sender-id
Summary: TpTextChannel never finishes preparing if there are pending messages with no ...
Alias: None
Product: Telepathy
Classification: Unclassified
Component: tp-glib (show other bugs)
Version: git master
Hardware: Other All
: medium normal
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
URL: http://cgit.collabora.com/git/user/wj...
Keywords: patch
Depends on:
Reported: 2011-07-12 07:26 UTC by Will Thompson
Modified: 2011-07-12 09:13 UTC (History)
0 users

See Also:
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.