#8430 NORM Not Tri: Shouldn't recreate Buddy objects that left

Zarro Boogs per Child bugtracker at laptop.org
Thu Sep 11 11:58:46 EDT 2008


#8430: Shouldn't recreate Buddy objects that left
---------------------------+------------------------------------------------
 Reporter:  gdesmott       |         Owner:  marco        
     Type:  defect         |        Status:  new          
 Priority:  normal         |     Milestone:  Not Triaged  
Component:  sugar-toolkit  |       Version:  not specified
 Keywords:                 |   Next_action:  never set    
 Verified:  0              |     Blockedby:               
 Blocking:                 |  
---------------------------+------------------------------------------------
 I connected 2 Chat instances on 2 XO's. I rebooted one and the remaining
 Chat didn't announce the other buddy left because of this error:

 {{{
 1221140894.853296 DEBUG sugar.presence.activity: <proxy for
 /org/laptop/Sugar/Presence/Activities/1 at 931df2c>: buddy
 /org/laptop/Sugar/Presence/Buddies/keyid/d48ee75006445746a5476589afd9107376c3112a
 left
 ---------------------------------------------------------------------------
 DBusException                             Traceback (most recent call
 last)

 /usr/lib/python2.5/site-packages/sugar/presence/activity.py in
 _emit_buddy_left_signal(self=<proxy for
 /org/laptop/Sugar/Presence/Activities/1 at 931df2c>,
 object_path=dbus.ObjectPath('/org/laptop/Sugar/Presence/Buddies/keyid/d48ee75006445746a5476589afd9107376c3112a'))
     211         XXX note use of _ps_new_object instead of _ps_del_object
 here
     212         """
 --> 213         self.emit('buddy-left', self._ps_new_object(object_path))
         self.emit = <built-in method emit of Activity object at 0x931df2c>
         self._ps_new_object = <bound method PresenceService._new_object of
 <PresenceService object at 0x931f1bc
 (sugar+presence+presenceservice+PresenceService at 0x93f6410)>>
         object_path =
 dbus.ObjectPath('/org/laptop/Sugar/Presence/Buddies/keyid/d48ee75006445746a5476589afd9107376c3112a')
     214         return False
     215

 /usr/lib/python2.5/site-packages/sugar/presence/presenceservice.py in
 _new_object(self=<PresenceService object at 0x931f1bc
 (sugar+presence+presenceservice+PresenceService at 0x93f6410)>,
 object_path=dbus.ObjectPath('/org/laptop/Sugar/Presence/Buddies/keyid/d48ee75006445746a5476589afd9107376c3112a'))
     173             if object_path.startswith(self._PS_BUDDY_OP):
     174                 obj = Buddy(self._bus, self._new_object,
 --> 175                         self._del_object, object_path)
         self._del_object = <bound method PresenceService._del_object of
 <PresenceService object at 0x931f1bc
 (sugar+presence+presenceservice+PresenceService at 0x93f6410)>>
         object_path =
 dbus.ObjectPath('/org/laptop/Sugar/Presence/Buddies/keyid/d48ee75006445746a5476589afd9107376c3112a')
     176             elif object_path.startswith(self._PS_ACTIVITY_OP):
     177                 obj = Activity(self._bus, self._new_object,

 /usr/lib/python2.5/site-packages/sugar/presence/buddy.py in
 __init__(self=<Buddy object at 0x9322694 (sugar+presence+buddy+Buddy at
 0x93a3b10)>, bus=<dbus._dbus.SessionBus (session) at 0x930fe6c>,
 new_obj_cb=<bound method PresenceService._new_object of
 <Pr...e+presenceservice+PresenceService at 0x93f6410)>>, del_obj_cb=<bound
 method PresenceService._del_object of
 <Pr...e+presenceservice+PresenceService at 0x93f6410)>>,
 object_path=dbus.ObjectPath('/org/laptop/Sugar/Presence/Buddies/keyid/d48ee75006445746a5476589afd9107376c3112a'))
      89                 'PropertyChanged', self._property_changed_cb)
      90
 ---> 91         self._properties = self._get_properties_helper()
         self._properties = {}
         self._get_properties_helper = <bound method
 Buddy._get_properties_helper of <Buddy object at 0x9322694
 (sugar+presence+buddy+Buddy at 0x93a3b10)>>
      92
      93         activities = self._buddy.GetJoinedActivities()

 /usr/lib/python2.5/site-packages/sugar/presence/buddy.py in
 _get_properties_helper(self=<Buddy object at 0x9322694
 (sugar+presence+buddy+Buddy at 0x93a3b10)>)
     105         """Retrieve the Buddy's property dictionary from the
 service object
     106         """
 --> 107         props = self._buddy.GetProperties(byte_arrays=True)
         props = undefined
         self._buddy.GetProperties = <dbus.proxies._ProxyMethod instance at
 0x93b97ac>
         global byte_arrays = undefined
         global True = undefined
     108         if not props:
     109             return {}

 /usr/lib/python2.5/site-packages/dbus/proxies.py in
 __call__(self=<dbus.proxies._DeferredMethod instance at 0x93255ec>,
 *args=(), **keywords={'byte_arrays': True})
      66             # we're being synchronous, so block
      67             self._block()
 ---> 68             return self._proxy_method(*args, **keywords)
         self._proxy_method = <dbus.proxies._ProxyMethod instance at
 0x9325bac>
         args = ()
         keywords = {'byte_arrays': True}
      69
      70     def call_async(self, *args, **keywords):

 /usr/lib/python2.5/site-packages/dbus/proxies.py in
 __call__(self=<dbus.proxies._ProxyMethod instance at 0x9325bac>, *args=(),
 **keywords={'byte_arrays': True})
     138                                                   introspect_sig,
     139                                                   args,
 --> 140                                                   **keywords)
         keywords = {'byte_arrays': True}
     141
     142     def call_async(self, *args, **keywords):

 /usr/lib/python2.5/site-packages/dbus/connection.py in
 call_blocking(self=<dbus._dbus.SessionBus (session) at 0x930fe6c>,
 bus_name=dbus.UTF8String(':1.2'),
 object_path=dbus.ObjectPath('/org/laptop/Sugar/Presence/Buddies/keyid/d48ee75006445746a5476589afd9107376c3112a'),
 dbus_interface='org.laptop.Sugar.Presence.Buddy', method='GetProperties',
 signature=None, args=(), timeout=-1.0, utf8_strings=False,
 byte_arrays=True)
     620         # make a blocking call
     621         reply_message = self.send_message_with_reply_and_block(
 --> 622             message, timeout)
         message = <dbus.lowlevel.MethodCallMessage object at 0x8e1c8a0>
         timeout = -1.0
     623         args_list = reply_message.get_args_list(**get_args_opts)
     624         if len(args_list) == 0:

 DBusException: org.freedesktop.DBus.Error.UnknownMethod: Method
 "GetProperties" with signature "" on interface
 "org.laptop.Sugar.Presence.Buddy" doesn't exist
 }}}

 This is because the Buddy disappeared and so was removed from the object
 cache. So when the Activity object tries to emit the "buddy-left" signal,
 he has to recreate a new (sugar) Buddy object wrapping an unexisting PS
 Buddy object.

-- 
Ticket URL: <http://dev.laptop.org/ticket/8430>
One Laptop Per Child <http://laptop.org/>
OLPC bug tracking system


More information about the Bugs mailing list