Skip to content
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

fix: ignore late pings #5457

Merged
merged 3 commits into from
Jun 16, 2024
Merged

fix: ignore late pings #5457

merged 3 commits into from
Jun 16, 2024

Conversation

Nerixyz
Copy link
Contributor

@Nerixyz Nerixyz commented Jun 15, 2024

When sleeping, both incoming messages and timer invocations are stalled and (kind of) replayed when waking up (i.e. Communi::IrcConnection::messageReceived will fire pending events after waking up and pingTimer_ will fire the pending ping). This leads to a heartbeat.

The logs before are from SevenTV/chatterino7@chatterino7...355acd5 and the logs after are from SevenTV/chatterino7@chatterino7...nerix/rm-logging.

Logs before
2024-06-14T20:28:15 chatterino.irc: Communi::IrcConnection::messageReceived "PRIVMSG"
2024-06-14T20:28:15 chatterino.irc: Communi::IrcConnection::messageReceived "PRIVMSG"
2024-06-14T20:28:15 chatterino.irc: Communi::IrcConnection::messageReceived "PRIVMSG"
2024-06-14T22:39:12 chatterino.irc: Communi::IrcConnection::messageReceived "PRIVMSG"
2024-06-14T22:39:12 chatterino.irc: Communi::IrcConnection::messageReceived "PRIVMSG"
2024-06-14T22:39:12 chatterino.irc: Communi::IrcConnection::messageReceived "PRIVMSG"
2024-06-14T22:39:12 chatterino.irc: Reconnecting
2024-06-14T22:39:12 chatterino.irc: pingTimer
2024-06-14T22:39:12 chatterino.recentmessages: "[...]" markConnected QDateTime(2024-06-14 20:39:12.670 UTC Qt::UTC)
Logs after
2024-06-15T20:25:54 chatterino.irc: Communi::IrcConnection::messageReceived "PRIVMSG" QDateTime(2024-06-15 20:25:54.633 Mitteleuropäische Sommerzeit Qt::LocalTime)
2024-06-15T20:25:54 chatterino.irc: Communi::IrcConnection::messageReceived "PRIVMSG" QDateTime(2024-06-15 20:25:54.938 Mitteleuropäische Sommerzeit Qt::LocalTime)
2024-06-15T20:25:55 chatterino.irc: pingTimer
2024-06-15T20:25:55 chatterino.irc: Communi::IrcConnection::messageReceived "PRIVMSG" QDateTime(2024-06-15 20:25:55.361 Mitteleuropäische Sommerzeit Qt::LocalTime)
2024-06-15T20:25:55 chatterino.irc: Communi::IrcConnection::messageReceived "PRIVMSG" QDateTime(2024-06-15 20:25:55.597 Mitteleuropäische Sommerzeit Qt::LocalTime)
2024-06-15T20:25:55 chatterino.irc: Communi::IrcConnection::messageReceived "PRIVMSG" QDateTime(2024-06-15 20:25:55.699 Mitteleuropäische Sommerzeit Qt::LocalTime)
2024-06-15T20:25:55 chatterino.irc: Communi::IrcConnection::messageReceived "PRIVMSG" QDateTime(2024-06-15 20:25:55.845 Mitteleuropäische Sommerzeit Qt::LocalTime)
2024-06-15T20:25:55 chatterino.irc: Communi::IrcConnection::messageReceived "PRIVMSG" QDateTime(2024-06-15 20:25:55.879 Mitteleuropäische Sommerzeit Qt::LocalTime)
2024-06-15T20:26:09 chatterino.irc: Reconnecting
2024-06-15T20:26:09 chatterino.irc: Communi::IrcConnection::messageReceived "PRIVMSG" QDateTime(2024-06-15 20:26:09.549 Mitteleuropäische Sommerzeit Qt::LocalTime)
2024-06-15T20:26:09 chatterino.irc: Communi::IrcConnection::messageReceived "PRIVMSG" QDateTime(2024-06-15 20:26:09.564 Mitteleuropäische Sommerzeit Qt::LocalTime)
2024-06-15T20:26:09 chatterino.irc: pingTimer
2024-06-15T20:26:09 chatterino.irc: no ping!
2024-06-15T20:26:09 chatterino.irc: pingTimer
2024-06-15T20:26:09 chatterino.irc: no ping!
2024-06-15T20:26:09 chatterino.irc: Communi::IrcConnection::messageReceived "PONG" QDateTime(2024-06-15 20:26:09.618 Mitteleuropäische Sommerzeit Qt::LocalTime)
2024-06-15T20:26:10 chatterino.irc: Communi::IrcConnection::messageReceived "PRIVMSG" QDateTime(2024-06-15 20:26:10.111 Mitteleuropäische Sommerzeit Qt::LocalTime)
2024-06-15T20:26:10 chatterino.irc: Communi::IrcConnection::messageReceived "PRIVMSG" QDateTime(2024-06-15 20:26:10.122 Mitteleuropäische Sommerzeit Qt::LocalTime)
2024-06-15T20:26:10 chatterino.irc: Communi::IrcConnection::messageReceived "PRIVMSG" QDateTime(2024-06-15 20:26:10.566 Mitteleuropäische Sommerzeit Qt::LocalTime)
2024-06-15T20:26:10 chatterino.irc: Communi::IrcConnection::messageReceived "PRIVMSG" QDateTime(2024-06-15 20:26:10.718 Mitteleuropäische Sommerzeit Qt::LocalTime)
2024-06-15T20:26:10 chatterino.irc: Communi::IrcConnection::messageReceived "PRIVMSG" QDateTime(2024-06-15 20:26:10.764 Mitteleuropäische Sommerzeit Qt::LocalTime)
2024-06-15T20:26:10 chatterino.irc: Communi::IrcConnection::messageReceived "PRIVMSG" QDateTime(2024-06-15 20:26:10.919 Mitteleuropäische Sommerzeit Qt::LocalTime)
2024-06-15T20:26:11 chatterino.irc: Communi::IrcConnection::messageReceived "PRIVMSG" QDateTime(2024-06-15 20:26:11.056 Mitteleuropäische Sommerzeit Qt::LocalTime)
2024-06-15T22:47:35 chatterino.irc: Communi::IrcConnection::messageReceived "PRIVMSG" QDateTime(2024-06-15 22:47:35.423 Mitteleuropäische Sommerzeit Qt::LocalTime)
2024-06-15T22:47:35 chatterino.irc: Communi::IrcConnection::messageReceived "PRIVMSG" QDateTime(2024-06-15 22:47:35.568 Mitteleuropäische Sommerzeit Qt::LocalTime)
2024-06-15T22:47:35 chatterino.irc: Communi::IrcConnection::messageReceived "PRIVMSG" QDateTime(2024-06-15 22:47:35.652 Mitteleuropäische Sommerzeit Qt::LocalTime)
2024-06-15T22:47:35 chatterino.irc: Communi::IrcConnection::messageReceived "PRIVMSG" QDateTime(2024-06-15 22:47:35.670 Mitteleuropäische Sommerzeit Qt::LocalTime)
2024-06-15T22:47:42 chatterino.irc: Connection error: QAbstractSocket::RemoteHostClosedError
2024-06-15T22:47:42 chatterino.irc: Read connection reconnect requested. Timeout: false
2024-06-15T22:47:42 chatterino.irc: Reconnecting in 1000 ms
2024-06-15T22:47:42 chatterino.notification: fetching fake channels
2024-06-15T22:47:42 chatterino.twitch.livecontroller: Make 1 requests
2024-06-15T22:47:43 chatterino.irc: pingTimer
2024-06-15T22:47:43 chatterino.irc: no ping!

Fixes #5453.

@pajlada pajlada enabled auto-merge (squash) June 16, 2024 09:10
@pajlada pajlada merged commit 86871ee into Chatterino:master Jun 16, 2024
17 checks passed
@Nerixyz Nerixyz deleted the fix/sleepy-pings branch June 16, 2024 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Message history doesn't load after sleep
2 participants