Discard null sequences in the gateway.

This was forbidding the Discord gateway from allowing us to RESUME
properly, causing an over-abundance of READY being called.
This commit is contained in:
Rapptz 2016-12-16 18:08:12 -05:00
parent b1117262da
commit 6306fc08db

View File

@ -186,7 +186,7 @@ class DiscordWebSocket(websockets.client.WebSocketClientProtocol):
log.info('Created websocket connected to {}'.format(gateway))
# poll the event for OP HELLO
# poll event for OP Hello
yield from ws.poll_event()
if not resume:
@ -289,9 +289,9 @@ class DiscordWebSocket(websockets.client.WebSocketClientProtocol):
op = msg.get('op')
data = msg.get('d')
if 's' in msg:
state.sequence = msg['s']
seq = msg.get('s')
if seq is not None:
state.sequence = seq
if op == self.RECONNECT:
# "reconnect" can only be handled by the Client