From 114cf622d6ea0d451cbb30ba8c5013915e016bc4 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Mon, 11 Mar 2024 15:06:23 +0200 Subject: [PATCH] Add longer hacky sleep to make google login post-connect work --- libgm/client.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libgm/client.go b/libgm/client.go index e44039e..f273ecc 100644 --- a/libgm/client.go +++ b/libgm/client.go @@ -166,10 +166,16 @@ func (c *Client) Connect() error { func (c *Client) postConnect() { time.Sleep(2 * time.Second) - c.Logger.Debug().Msg("Sending acks before get updates request") if c.skipCount > 0 { - c.Logger.Warn().Int("skip_count", c.skipCount).Msg("Skip count is still non-zero") + c.Logger.Warn().Int("skip_count", c.skipCount).Msg("Skip count is non-zero in postConnect, waiting longer") + for i := 0; i < 10 && c.skipCount > 0; i++ { + time.Sleep(1 * time.Second) + } + if c.skipCount > 0 { + c.Logger.Warn().Int("skip_count", c.skipCount).Msg("Skip count is still non-zero") + } } + c.Logger.Debug().Msg("Sending acks before get updates request") c.sessionHandler.sendAckRequest() time.Sleep(1 * time.Second) c.Logger.Debug().Msg("Sending get updates request")