diff --git a/socketio/asyncio_server.py b/socketio/asyncio_server.py index a4c404d..dcb4307 100644 --- a/socketio/asyncio_server.py +++ b/socketio/asyncio_server.py @@ -443,11 +443,11 @@ class AsyncServer(server.Server): namespace_list = [namespace] for n in namespace_list: if n != '/' and self.manager.is_connected(sid, n): - self.manager.pre_disconnect(sid, namespace=namespace) + self.manager.pre_disconnect(sid, namespace=n) await self._trigger_event('disconnect', n, sid) self.manager.disconnect(sid, n) if namespace == '/' and self.manager.is_connected(sid, namespace): - self.manager.pre_disconnect(sid, namespace=namespace) + self.manager.pre_disconnect(sid, namespace='/') await self._trigger_event('disconnect', '/', sid) self.manager.disconnect(sid, '/') diff --git a/socketio/server.py b/socketio/server.py index 7874804..2af55c5 100644 --- a/socketio/server.py +++ b/socketio/server.py @@ -652,11 +652,11 @@ class Server(object): namespace_list = [namespace] for n in namespace_list: if n != '/' and self.manager.is_connected(sid, n): - self.manager.pre_disconnect(sid, namespace=namespace) + self.manager.pre_disconnect(sid, namespace=n) self._trigger_event('disconnect', n, sid) self.manager.disconnect(sid, n) if namespace == '/' and self.manager.is_connected(sid, namespace): - self.manager.pre_disconnect(sid, namespace=namespace) + self.manager.pre_disconnect(sid, namespace='/') self._trigger_event('disconnect', '/', sid) self.manager.disconnect(sid, '/')