Bug 27736

Summary: Error when getting caps
Product: Telepathy Reporter: Xavier Claessens <xclaesse>
Component: butterflyAssignee: Telepathy bugs list <telepathy-bugs>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium Keywords: patch
Version: unspecified   
Hardware: Other   
OS: All   
URL: http://git.collabora.co.uk/?p=user/olethanh/telepathy-butterfly.git;a=shortlog;h=refs/heads/fix27736
Whiteboard:
i915 platform: i915 features:

Description Xavier Claessens 2010-04-19 06:12:10 UTC
Using Butterfly 0.5.8 and current Empathy master, at startup I get that message for each contact:

(empathy:9584): empathy-DEBUG: tp_contact_factory_got_contact_capabilities: Error: org.freedesktop.DBus.Python.KeyError: Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/dbus/service.py", line 702, in _message_cb
    retval = candidate_method(self, *args, **keywords)
  File "/usr/lib/python2.6/dist-packages/butterfly/capabilities.py", line 99, in GetContactCapabilities
    ret[handle] = self._contact_caps[handle]
KeyError: <butterfly.handle.ButterflyContactHandle object at 0x21eb550>
Comment 1 Jonny Lamb 2010-04-22 16:39:22 UTC
19:23 < jonnylamb> Zdra: Odd. The method call works for ~half of your contacts,
                   but fails for the other half.
19:29 < jonnylamb> Zdra: Could you apply this butterfly patch and try again
                   please --
                   http://people.collabora.co.uk/~jonny/butterfly-caps-diff
19:29 < jonnylamb> Zdra: If it doesn't work, please give me some butterfly logs.
Comment 2 Jonny Lamb 2010-05-03 05:54:08 UTC
This patch should do it.

Xavier, can you try this out and confirm Empathy stops complaining please? You can easily run butterfly straight from the source tree.
Comment 3 Guillaume Desmottes 2010-05-05 04:12:53 UTC
With this patch my account stays in the "Connecting" state. Logs contains loads of
DEBUG:Butterfly.Capabilities:Going to add text capabilities to badger@hotmail.com

and then nothing.

Note that without the patch my account connects but I don't see any contact.
Comment 4 Xavier Claessens 2010-05-08 15:15:02 UTC
Same as Guillaume said, I'm adding that with the patch butterfly enters an infinite loop and takes 100% CPU
Comment 5 Xavier Claessens 2010-05-08 15:45:25 UTC
The infinite loop is in _populate_capabilities, because it apply all self._update_capabilities_calls but status is not yet CONNECTED, so self.UpdateCapabilities will add item back to the list it is iterating.

If I comment out that loop, accout connects but I have no contact.
Comment 6 Mike Ruprecht 2010-05-13 04:54:35 UTC
Zdra says this branch of mine fixes this issue for him: http://git.collabora.co.uk/?p=user/maiku/telepathy-butterfly.git;a=shortlog;h=refs/heads/signature

It also fixes a slightly different issue for me (See commit comment for details).
Comment 7 Olivier Le Thanh Duong 2010-05-13 15:40:18 UTC
Using empathy master, jonny patch showed no contacts because of a wrong signature and Maiku patch resulted in a small non-fatal error for contact with no caps. I merged both and it seems to work fine.
Comment 8 Louis-Francis Ratté-Boulianne 2010-05-14 11:32:51 UTC
review+
Comment 9 Olivier Le Thanh Duong 2010-05-17 06:01:11 UTC
Merged thanks

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.