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

request context should not be needed when calling emit() with namespace #213

Merged
merged 1 commit into from Mar 2, 2016
Merged

request context should not be needed when calling emit() with namespace #213

merged 1 commit into from Mar 2, 2016

Conversation

ntamas
Copy link
Contributor

@ntamas ntamas commented Jan 22, 2016

This pull request fixes a minor issue with emit(), which used to require a request context even when the namespace argument was specified. This happens because kwargs.get() evaluates its second argument in an eager manner. The pull request fixes this by replacing kwargs.get() with a membership check, falling back to the namespace of the current request context only if the namespace keyword argument is not present.

@ntamas
Copy link
Contributor Author

ntamas commented Mar 1, 2016

Sorry for being pushy, but is there any chance to merge this into the next release at some point? Currently I'm relying on this patch to make some of our codebase work, but I can't convince Heroku to install Flask-SocketIO from our patched branch on Github instead of PyPI so I can't deploy this fix to Heroku. It would be great if this could be merged eventually.

If you cannot merge this in the near future, let me know and I'll try to work around this in our own codebase instead.

miguelgrinberg added a commit that referenced this pull request Mar 2, 2016
request context should not be needed when calling emit() with namespace
@miguelgrinberg miguelgrinberg merged commit 2416565 into miguelgrinberg:master Mar 2, 2016
@miguelgrinberg
Copy link
Owner

Nice and simple, thanks!

I was planning to work on a couple issues before doing another release, but if this is really urgent, I can push one out now and do another in a few days. Let me know.

@ntamas
Copy link
Contributor Author

ntamas commented Mar 2, 2016

Great, and no, it's not that urgent, I can definitely wait for a few more days. Thanks a lot!

@ntamas ntamas deleted the fix-request-context-in-emit branch March 2, 2016 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants