Emit isn't received by the originating user if you leave all the rooms #2025
fireattack
started this conversation in
General
Replies: 1 comment
-
I think a more appropriate way to address this issue would be to change |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Today I was testing something and find a confusing interaction.
Considering the following code:
Apparently, the message sent at the end won't be received by the client side.
According to https://flask-socketio.readthedocs.io/en/latest/api.html#flask_socketio.emit:
So I would assume the originating user would always receive it no matter what.
After some debugging, I found that the implementation seems to be that every session is in a hidden room that is named by its session ID. By running
for r in rooms(): leave_room(r)
, you left that hidden room too, So the client can no longer receive any personal emit from server end.This at least isn't clear to me from the documentation, and I can't seem to find anything about it by some quick googling.
I was wondering if we can improve the documentation to make it more clear.
Cheers!
Beta Was this translation helpful? Give feedback.
All reactions