diff --git a/sneed/client.go b/sneed/client.go index 02cf02c..f196a82 100644 --- a/sneed/client.go +++ b/sneed/client.go @@ -226,9 +226,17 @@ func (c *Client) handleDisconnect() { } log.Println("🟢 Reconnected successfully") + + // 🚦 Allow websocket handshake to stabilize + time.Sleep(2 * time.Second) + + // 🔁 Re-join chat room and verify connection c.joinRoom() + c.Send("/ping") + log.Printf("🔁 Rejoined Sneedchat room %d after reconnect", c.roomID) } + func (c *Client) Disconnect() { close(c.stopCh) c.mu.Lock()