-
-
Notifications
You must be signed in to change notification settings - Fork 442
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
Improve Twitch PubSub connection reliability #3643
Conversation
This prevents a deadlock if a connection fails since `addingClient` will never be set to `false`.
For pubsub tests, https://github.com/Chatterino/twitch-pubsub-server-test will need to run on your system (or in a docker image). Will sort this out later
I've tested the current code for the past 4 days and had no issues, both redemptions and automod continue to work in comparison to before where they'd just ⚰️. |
I do think this is a bugfix, but the concept of this fix belongs as high up as it can be in the changelog, I'd probably stick it at the top of the changelog (because apparently people actually do read the changelog, who knew.) |
Move automod message parsing logic out of pubsubmanager since it relied on settings Bump pubsub server to v1.0.3
Pull request checklist:
CHANGELOG.md
was updated, if applicableDescription
Improve connection stability
Additional changes
magic_enum
library has been added as a dependencyPubsub
have been changed toPubSub
to be consistent with capitalizationOld description
This prevents a deadlock if a connection fails since
addingClient
will never be set tofalse
.The documentation for websocketpp says:
Since we don't listen for fails,
addingClient
will betrue
forever if the first connection fails, effectively resulting in a deadlock (thePubSub topic backlog
will never decrease). This PR attempts to fix this bug.There's a new bug however: If the connection will always be closed, then we will spam Twitch with requests. Maybe this should be throttled?