Description
Hi there old friend,
We just upgraded from 4.6.1 to 5.0.4. Prior to the upgrade, our code was working totally fine but now occasionally crashes.
Our code first callsconnect(url, transports=["websockets"], headers={"Authorization": "FakeAuthHeader"})
which succeeds and the library's logging prints Engine.IO connection established
. Sometimes, it then promptly prints Namespace / is connected
. Other times, our code reaches emit("auth", API_KEY)
which then errors with socketio.exceptions.BadNamespaceError: / is not a connected namespace.
but interleaved in the traceback is Namespace / is connected
. It seems like there's a race-condition in how connect(...) -> _handle_eio_connect -> _send_packet -> _handle_connect
flows and it's not entirely synchronous.
I skimmed the code but didn't immediately see the problem. Hopefully this helps.