From c98cae4e838147eaa077bbc68ffebf8834ff7b6b Mon Sep 17 00:00:00 2001 From: Zeyla Hellyer Date: Mon, 9 Oct 2017 12:37:40 -0700 Subject: Reset shard heartbeat state on resume When a resume is received, the heartbeat state would not be reset. This state includes: - whether the last heartbeat was acknowledged - when the last heartbeat was sent - when the last heartbeat acknowledgement was received This resulted in the bot re-IDENTIFYing after a Resumed event was received. To fix this issue, reset them when a Resumed event is received. --- src/gateway/shard.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/gateway/shard.rs b/src/gateway/shard.rs index 9304e2f..fbe1572 100644 --- a/src/gateway/shard.rs +++ b/src/gateway/shard.rs @@ -354,6 +354,8 @@ impl Shard { info!("[Shard {:?}] Resumed", self.shard_info); self.stage = ConnectionStage::Connected; + self.last_heartbeat_acknowledged = true; + self.heartbeat_instants = (Some(Instant::now()), None); }, #[cfg_attr(rustfmt, rustfmt_skip)] ref _other => { -- cgit v1.2.3