New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disconnecting from sid room yields unexpected disconnecting behavior #1283
Comments
What would be the purpose of closing a sid room? The code unfortunately does not currently validate against this, but the sid rooms are not meant to be touched, they are just there to facilitate addressing individual clients. Need to add validation to ignore such requests. |
I can't think of a reason why anyone would, other than to mess something up. Moving forward, I'll just hide the user's sid from them when displaying their current rooms. |
Describe the bug
In the process of learning how Flask-SocketIO works, I was playing around with the example provided in
example/app.py
. I noticed that if you close thesid
room you are in, when you then issue thedisconnect_request
command, nothing happens, and you continue to stay connected (although refreshing the page seems to then properly disconnect you).I changed the
disconnect_request
function to just calldisconnect()
, and in this case, it works correctly, suggesting it's something to do with the callback function implementation. To be honest, I'm not entirely sure if this is unexpected behavior or not, but I can't find anything in the JS code inindex.html
to suggest that disconnected from thesid
room would screw things up.To Reproduce
I'm using Python 3.4 with the default Werkzeug server with the
eventlet
async mode on OSX 10.12 with Chrome 81.Steps to reproduce the behavior:
app.py
in theexample
folder with, logger=True, engineio_logger=True
in theSocketIO
options.Expected behavior
I would have assumed that
disconnect_request
would work even if you have left your original sid room.Logs
It then continues as normal, continuing to ping the client and send regular 'Server generated event[s]
. I included so many lines after the
disconnect_requestbecause the
emitting event "my_response" to all [/test]` log only seems to happen when there are no clients connected, and after that one instance, never happens again.The text was updated successfully, but these errors were encountered: