Summary: | Race when preparing blocked contacts | ||
---|---|---|---|
Product: | Telepathy | Reporter: | Guillaume Desmottes <guillaume.desmottes> |
Component: | tp-glib | Assignee: | Telepathy bugs list <telepathy-bugs> |
Status: | RESOLVED FIXED | QA Contact: | Telepathy bugs list <telepathy-bugs> |
Severity: | normal | ||
Priority: | medium | CC: | xclaesse |
Version: | git master | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: | tp_connection_upgrade_contacts(): Use special trick of ready_enough_for_contacts |
Description
Guillaume Desmottes
2012-07-24 11:52:24 UTC
The problem here is RequestBlockedContacts returns before TP_CONNECTION_FEATURE_CONNECTED is prepared. This is probably because the CM is actually connected but TpProxy does more extra stuff before marking the CONNECTED feature. Possible fix for this is to make TP_CONNECTION_FEATURE_CONTACT_BLOCKING feature depend on TP_CONNECTION_FEATURE_CONNECTED, so preparing BLOCKING will wait until connection goes online. This has a side effect that if you naïvely add that feature on the factory, TpAccount will never signal the connection until it's done connecting... Another solution (and that's what CONTACT_LIST feature does) is to just immediately return success if the connection is not yet connected, then emit "blocked-contacts-changed" signal with the initial set once the connection is connected. (In reply to comment #1) > This has a side effect that if you naïvely add > that feature on the factory, TpAccount will never signal the connection until > it's done connecting... I don't like this. > Another solution (and that's what CONTACT_LIST feature does) is to just > immediately return success if the connection is not yet connected I prefer this one. Created attachment 64613 [details] [review] tp_connection_upgrade_contacts(): Use special trick of ready_enough_for_contacts TpConnection itself wants to prepare TpContacts before being officially CONNECTED. This was already the case for self contact. Use the same trick for blocked contacts. After digging, it seems it's actually easier than I though. We already has such trick for the self contact which uses the _by_handle() path, now do the same for blocked contacts which uses the _upgrade_contacts() path. The idea is that TpConnection itself can prepare contacts before being officially CONNECTED. Comment on attachment 64613 [details] [review] tp_connection_upgrade_contacts(): Use special trick of ready_enough_for_contacts Review of attachment 64613 [details] [review]: ----------------------------------------------------------------- Looks good but shouldn't we do the same in tp_connection_get_contacts_by_id() ? _by_id() should not be used internally, it is (or should be) used only for IDs typed by the user in the UI. I see; ++ Merged in both 0.18 and master. telepathy-glib-0.18.2, telepathy-glib-0.19.5 |
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.