TwitchLib / TwitchLib.EventSub.Websockets

TwitchLib component for EventSub over Websockets
MIT License
5 stars 15 forks source link

After a few minutes with EventSubWebSocket, sometimes getting "Failed Ping Pong" disconnect #48

Open WrithemTwine opened 1 week ago

WrithemTwine commented 1 week ago

Using 'auth code' access tokens w/access scopes; get access token. Start EventSub 'startasync' and subsequent Helix "create ChatMessageReceived subscription" after 'OnConnected'.

I'm using the EventSubWebSocket(ILoggerFactory) constructor, https://github.com/TwitchLib/TwitchLib.EventSub.Websockets/blob/bd20f9d3dc6beb1b85ea2073aca6a02f214f6426/TwitchLib.EventSub.Websockets/EventSubWebsocketClient.cs#L318

Tried several times (validating with "!command" type calls to channel and getting 'sendchatmessage' responses), sometimes can last 20+ minutes connected to channel, or within 2-3 minutes receive: image

The authcode access tokens have checks and refresh as needed. In this case, the access tokens are already refreshed and would/should be ok for hours.

image

(still working on reliable logging for more information, have captured "failed ping pong" though)

Syzuna commented 1 week ago

Interesting. What you experienced, the low level ping/pong failing (Code 4002) would be handled outside of TwitchLib inside the .NET Websocket implementation tho so I dont know if this is sth we can help with but rather an intermittend connection issue on your end to AWS.

WrithemTwine commented 3 days ago

I missed this part of the documentation about subscription access: https://dev.twitch.tv/docs/eventsub/manage-subscriptions/ "The Subscription Types topic lists the scope requirement for each event. If the event doesn’t specify a scope requirement, you must create a user access token with no scope."

Found out, I mixed scope/no scope subscriptions together and Twitch doesn't like that. so I'll be separating subscriptions into another eventsub instance.