Skip to content
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

skip_sid and other arguments are not passed on to socketio.emit #1147

Closed
smackware opened this issue Jan 7, 2020 · 0 comments
Closed

skip_sid and other arguments are not passed on to socketio.emit #1147

smackware opened this issue Jan 7, 2020 · 0 comments
Assignees
Labels

Comments

@smackware
Copy link

Describe the bug
I notice that skip_sid is ignored (client would receive messages although I explicitly stated them not to, as pet the documentation)
The emit function in init.py explicitly emits that argument and many other possible arguments

To Reproduce
Steps to reproduce the behavior:

  1. Set up a server using flask_socketio
  2. Create a simple event that emits back a message, with skip_sid=request.sid
  3. A client that send that former event, see client receiving the event even though their SID is in skip_sid

Expected behavior
Client who is specified in skip_sid should not get the message

Logs

Additional context
I created a workaround which I believe should also serve as the proper content of the emit function itself:

def emit_(*args, **kwargs):
    if 'namespace' not in kwargs:
        kwargs['namespace'] = flask.request.namespace
    if 'room' not in kwargs:
        kwargs['room'] = flask.request.sid
    socketio.emit(*args, **kwargs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants