Disconnecting during a channel creation doesn't unregister the path of channel
@olethanh
Submitted by Olivier Le Thanh Duong Assigned to Telepathy bugs list
Description
When we disconnect butterfly while it's creating a channel, the dbus path is already registered but we don't unregister it afterward. So after we reconnect and try to open a channel with the same name it fail, however Empathy seems to still use the channel and the messages we send are losts
Error when disconnecting :
Traceback (most recent call last): File "/home/olivier/Projects/papyon/papyon/client.py", line 471, in event self._dispatch(method_name, *args[:-1]) File "/home/olivier/Projects/papyon/papyon/event/init.py", line 44, in _dispatch if event_handler._dispatch_event(name, *args): File "/home/olivier/Projects/papyon/papyon/event/init.py", line 65, in _dispatch_event handler(*params) File "/home/olivier/Projects/telepathy-butterfly/butterfly/connection.py", line 461, in on_oim_messages_fetched signal=True) File "/home/olivier/test/lib/python2.6/site-packages/telepathy/server/channelmanager.py", line 120, in channel_for_props return self.create_channel_for_props(props, signal, **args) File "/home/olivier/test/lib/python2.6/site-packages/telepathy/server/channelmanager.py", line 105, in create_channel_for_props props, **args) File "/home/olivier/Projects/telepathy-butterfly/butterfly/channel_manager.py", line 151, in _get_text_channel object_path=path) File "/home/olivier/Projects/telepathy-butterfly/butterfly/channel/im.py", line 54, in init conversation = papyon.Conversation(client, [contact]) File "/home/olivier/Projects/papyon/papyon/conversation.py", line 62, in Conversation return SwitchboardConversation(client, contacts) File "/home/olivier/Projects/papyon/papyon/conversation.py", line 421, in init SwitchboardClient.init(self, client, contacts, priority=0) File "/home/olivier/Projects/papyon/papyon/switchboard_manager.py", line 54, in init self._process_pending_queues() File "/home/olivier/Projects/papyon/papyon/switchboard_manager.py", line 162, in _process_pending_queues if self._request_switchboard(): File "/home/olivier/Projects/papyon/papyon/switchboard_manager.py", line 185, in _request_switchboard self._switchboard_manager.request_switchboard(self, self._switchboard_priority) # may set the switchboard immediatly File "/home/olivier/Projects/papyon/papyon/switchboard_manager.py", line 260, in request_switchboard request_switchboard(priority, self._ns_switchboard_request_response, handler) File "/home/olivier/Projects/papyon/papyon/util/decorator.py", line 111, in new_function func(*args, **kwargs) File "/home/olivier/Projects/papyon/papyon/msnp/notification.py", line 219, in request_switchboard self._send_command('XFR', ('SB',)) File "/home/olivier/Projects/papyon/papyon/msnp/base.py", line 80, in _send_command increment, callback, *cb_args) File "/home/olivier/Projects/papyon/papyon/transport.py", line 207, in send_command_ex self.send_command(cmd, increment, callback, *cb_args) File "/home/olivier/Projects/papyon/papyon/transport.py", line 277, in send_command self._transport.send(str(command), self.__on_command_sent, *our_cb_args) File "/home/olivier/Projects/papyon/papyon/gnet/io/iochannel.py", line 157, in send assert(self._status == IoStatus.OPEN), self._status AssertionError: 1 DEBUG:Butterfly.MailN
When a new connection is made and we try to reopen the channel: DEBUG:Butterfly.ChannelManager:New text channel Traceback (most recent call last): File "/home/olivier/Projects/papyon/papyon/client.py", line 471, in event self._dispatch(method_name, *args[:-1]) File "/home/olivier/Projects/papyon/papyon/event/init.py", line 44, in _dispatch if event_handler._dispatch_event(name, *args): File "/home/olivier/Projects/papyon/papyon/event/init.py", line 65, in _dispatch_event handler(*params) File "/home/olivier/Projects/telepathy-butterfly/butterfly/connection.py", line 461, in on_oim_messages_fetched signal=True) File "/home/olivier/test/lib/python2.6/site-packages/telepathy/server/channelmanager.py", line 120, in channel_for_props return self.create_channel_for_props(props, signal, **args) File "/home/olivier/test/lib/python2.6/site-packages/telepathy/server/channelmanager.py", line 105, in create_channel_for_props props, **args) File "/home/olivier/Projects/telepathy-butterfly/butterfly/channel_manager.py", line 151, in _get_text_channel object_path=path) File "/home/olivier/Projects/telepathy-butterfly/butterfly/channel/im.py", line 42, in init ButterflyTextChannel.init(self, conn, manager, conversation, props, object_path) File "/home/olivier/Projects/telepathy-butterfly/butterfly/channel/text.py", line 56, in init object_path=object_path) File "/home/olivier/test/lib/python2.6/site-packages/telepathy/server/channel.py", line 232, in init object_path=object_path) File "/home/olivier/test/lib/python2.6/site-packages/telepathy/server/channel.py", line 62, in init _Channel.init(self, self._conn._name, object_path) File "/usr/lib/pymodules/python2.6/dbus/service.py", line 480, in init self.add_to_connection(conn, object_path) File "/usr/lib/pymodules/python2.6/dbus/service.py", line 571, in add_to_connection self._fallback) KeyError: "Can't register the object-path handler for '/org/freedesktop/Telepathy/Connection/butterfly/msn/istaz_40live_2efr/TextChannel1': there is already a handler"