-
Notifications
You must be signed in to change notification settings - Fork 194
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
group_send accepts messages that it can't decode #217
Comments
I'm happy for you to report it there too, but I agree it might be nice if we could raise a helpful error. Do you have any appetite to prototype that up so we can see what it would look like? Thanks! |
The way I've handled it internally is to make a wrapper around group_send that ensures the message will unpack safely before sending it:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Running on the latest versions of the channels packages:
I started noticing that when I sent certain messages in my development environment (running in docker-compose with a redis:6.0.6 queue) my client would spontaneously disconnect. Unfortunately I couldn't see any errors, due to an open bug in django debug toolbar. After finally finding that out from another issue here, and rebuilding my environment without debug toolbar, I could finally see the error:
Which seems fair enough, and I have fixed our own code to not try to have None as a key. The reason I'm writing this bug report is, it seems like the code that is trying to send the message should raise an exception to have it localised there and easy to find & debug, but instead, this is in the code that receives that message from redis and is responsible for relaying it to the client.
In other words, the traceback above happened in my docker-compose
./manage.py runserver 0.0.0.0:8000
, but what triggered it was a separateshell_plus
window opened in the same application where I ran:I would expect this to raise an exception about the None key, instead of happily popping it onto the queue to then raise an exception when being unpacked.
Of course, this seems ultimately to be a problem with msgpack:
so if you'd prefer I reported it on that project, I'm happy to.
The text was updated successfully, but these errors were encountered: