You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems there is an issue with BaseManager.pending_removals getting stale and causing the removal of a user from a room they should be in.
Example (Imagine the various leave/enter/emit calls being spread out over time and multiple requests):
server= ... # Socket.IO Serverroom='my room'session_id= ... # Current session id for one user# Enter room normallyserver.enter_room(session_id, room)
# Leave room normally, server.manager.pending_removals populatedserver.leave_room(session_id, room)
# Re-enter room, server.manager.pending_removals still populatedserver.enter_room(session_id, room)
# Message emitted, followed by server.manager.pending_removals being processed internallyserver.emit('something', 'data', room=room)
# Message *NOT* emitted, because the room was removed after the previous emitserver.emit('something else', 'data', room=room)
The workaround was to do:
server= ... # Socket.IO Serverroom='my room'session_id= ... # Current session id for one user# Enter room normallyserver.enter_room(session_id, room)
# Leave room normally, server.manager.pending_removals populatedserver.leave_room(session_id, room)
# WORKAROUND: Force clean-up of old removals before entering the new roomserver.manager._clean_rooms()
# Re-enter room, server.manager.pending_removals is now clearserver.enter_room(session_id, room)
# Message emitted normallyserver.emit('something', 'data', room=room)
# Message emitted normallyserver.emit('something else', 'data', room=room)
This leads me to believe that the fix is likely something that needs to be added to enter_room( ... ) that reconciles the new subscriptions to a given room with the previous, perhaps unreconciled, room evictions in BaseManager.pending_removals.
The text was updated successfully, but these errors were encountered:
It seems there is an issue with
BaseManager.pending_removals
getting stale and causing the removal of a user from a room they should be in.Example (Imagine the various leave/enter/emit calls being spread out over time and multiple requests):
The workaround was to do:
This leads me to believe that the fix is likely something that needs to be added to
enter_room( ... )
that reconciles the new subscriptions to a given room with the previous, perhaps unreconciled, room evictions inBaseManager.pending_removals
.The text was updated successfully, but these errors were encountered: