Skip to content

_handle_reconnect doesnt care about registered namespaces #674

@tobyX

Description

@tobyX

Hello,
I create a Websocket connection and sometimes (for reasons currently unknown) this connection gets closed. SocketIO then tries to recreate the connection which is really good. But unfortunatelly it doestn care about my registered namespaces and so after the connection is reestablished I get an BadNamespaceError when emitting something.

Version is 5.1.0

socket = socketio.Client(ssl_verify=True, http_session=http_session)

socket.register_namespace(MyCustomSocketIONamespace)

socket.connect(
                'someURL'
                headers=headers,
                transports=['websocket']
)

socket.emit('some_event',  'some_data')

If I see this correctly _handle_eio_disconnect is called which removes all namespaces and _handle_reconnect doesnt restore them?
Or do we something wrong? Our implementation is a bit special as we create all events dynamically. Ah and we overwrite the default namespace, so our custom namespace is on /

If needed I can provide more examples and also a log (which I doesnt have currently, these reconnects are very random).

Thanks in advance and thank you for your great work!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions