Bug 27780

Summary: TpAccount doesn't always notify::connection
Product: Telepathy Reporter: Simon McVittie <smcv>
Component: tp-glibAssignee: Simon McVittie <smcv>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium CC: guillaume.desmottes, vinaysubscribe
Version: 0.10Keywords: patch
Hardware: Other   
OS: All   
URL: http://git.collabora.co.uk/?p=user/smcv/telepathy-glib-smcv.git;a=shortlog;h=refs/heads/010-account-notify
Whiteboard: review+
i915 platform: i915 features:

Description Simon McVittie 2010-04-21 12:28:40 UTC
TpAccount doesn't automatically create a new TpConnection when the connection_object_path member changes, only when someone actually asks for it.

This has the surprising side-effect that notify::connection isn't emitted when the object path is first discovered.

This block in _tp_account_update:

>   if (g_hash_table_lookup (properties, "Connection") != NULL)

should emit notify::connection; if someone actually cares about it, they'll call tp_account_get_connection (directly or via the property getter), resulting in the creation of a TpConnection.
Comment 1 Simon McVittie 2010-04-22 07:24:38 UTC
This branch might fix this, but is, so far, untested:

http://git.collabora.co.uk/?p=user/smcv/telepathy-glib-smcv.git;a=shortlog;h=refs/heads/010-account-notify
Comment 2 Simon McVittie 2010-04-23 11:27:25 UTC
I've updated the branch to include a regression test, and a fix for an unrelated TpAccount bug (it leaks the GHashTable containing parameters). Review would be appreciated; we can hopefully get this fixed in 0.10.5 and 0.11.4.
Comment 3 Guillaume Desmottes 2010-04-26 02:20:20 UTC
Looks good.
Comment 4 Simon McVittie 2010-04-26 04:34:46 UTC
Fixed in git telepathy-glib-0.10 and master; will be in 0.10.5 and 0.11.4, respectively.

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.