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

AssertionError on unordered CHANNEL_CREATE #21

Hornwitser opened this Issue Oct 19, 2015 · 1 comment


None yet
2 participants
Copy link

Hornwitser commented Oct 19, 2015

It's possible that messages are reordered such that a MESSAGE_CREATE event comes before the corresponding CHANNEL_CREATE for the private chat. This causes the code to crash with an AssertionError.

File "", line 316, in <module>
  File "/home/julian/prog/record/logger/discord/", line 518, in run
  File "/usr/lib/python3.5/site-packages/ws4py/", line 427, in run
    if not self.once():
  File "/usr/lib/python3.5/site-packages/ws4py/", line 305, in once
    if not self.process(b):
  File "/usr/lib/python3.5/site-packages/ws4py/", line 377, in process
  File "/home/julian/prog/record/logger/discord/", line 128, in received_message
    self.dispatch('socket_update', event, data)
  File "/home/julian/prog/record/logger/discord/", line 505, in dispatch
    getattr(self, handle_method, _null_event)(*args, **kwargs)
  File "/home/julian/prog/record/logger/discord/", line 513, in handle_socket_update
    getattr(self.connection, method)(data)
  File "/home/julian/prog/record/logger/discord/", line 211, in handle_message_create
    message = Message(channel=channel, **data)
  File "/home/julian/prog/record/logger/discord/", line 89, in __init__
  File "/home/julian/prog/record/logger/discord/", line 92, in _upgrade_to_member
    assert is not None

WebSocket Context (not much to see, it's just a message with an unknown channel id)

@Rapptz Rapptz added the bug label Oct 19, 2015

@Rapptz Rapptz modified the milestone: v0.9.0 Oct 20, 2015


This comment has been minimized.

Copy link

Rapptz commented Oct 28, 2015

As of c49ff36 the could be discord.Object in very rare scenarios.

@Rapptz Rapptz closed this Oct 28, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment