TwitchLib / TwitchLib.PubSub

PubSub component of TwitchLib.
38 stars 51 forks source link

Community Challenge Contributions Stops Events Firing #61

Closed JammyGeeza closed 3 years ago

JammyGeeza commented 4 years ago

Hi all,

Unsure if this is a bug with TwitchLib or if this is an issue with the PubSub API itself. Twitch have recently rolled out their Community Challenges feature here, where viewers can contribute channel points to a 'pool' and reach a target amount of points to have the streamer do something big in return.

I use the TwitchPubSub class to listen for Bits, Follows, Subscriptions and Channel Point Redemptions. I've taken advantage of the new Community Challenge feature, but have noticed that whenever a viewer makes a contribution, the TwitchPubSub.OnRewardRedeemed, TwitchPubSub.OnFollow and TwitchPubSub.OnBitsReceived immediately no longer fire for any future events. These were the ones I was able to test at the time. unfortunately I've not been able to test any of the other event yet.

Neither the TwitchPubSub.OnPubSubServiceError or TwitchPubSub.OnPubSubServiceClosed events fire, telling me that it has lost connection or an error occurred, but this could also just be because no events appear to fire anymore. It's hard to tell at this point. The only way I am able to get it working again is by stopping and restarting my bot, but then the same thing happens the next time somebody makes a contribution.

Has anybody else experienced this, or are able to replicate this?

Thanks in advance, Jamie

JayJay1989 commented 4 years ago

Hi @JammyGeeza, do you us your channelid and not the channelname to listen to the rewardredeemed event?

JammyGeeza commented 4 years ago

Hi @JayJay1989,

Yes, I use the channelid. My redemptions, follows, subscriptions and bits events have been working just fine for a while now. However, after implementing the Community Challenge into my Twitch channel, any time somebody makes a contribution, it seems to affect all events, not just OnRewardRedeemed.

arricc commented 4 years ago

I have a similar issue - not sure if it is the same or unrelated.

I listen specifically just for reward redemptions, then "do stuff". I have one reward that I test with - it doesn't do anything, but after a while the OnRewardRedeemed event just stops firing - no disconnect event, no errors. I can't see any easy way to inspect the connection state while debugging.

TwitchLib v3.1.1 & TwitchLibPubSub v3.1.4 via Nuget.

JayJay1989 commented 4 years ago

Can you try with the prerelease versions?

arricc commented 4 years ago

@JayJay1989 - thanks for the suggestion. Seems good so far. I have a stream later so hopefully it'll last all night!

Syzuna commented 4 years ago

Is this still an issue? Sorry for responding so late, kind of a rough time lately...

arricc commented 3 years ago

After trying the pre release version it feels a bit better, but still randomly stops working with no obvious reason.

swiftyspiffy commented 3 years ago

I'll look into this, this coming weekend.

Using the prerelease, can you try listening to the OnLog event and see what the last message logged was? That might be able to help us if there's a parsing issue.

Syzuna commented 3 years ago

Ok. Hoped the latest prerelease with the channel points fixes might have fixed this as well.

arricc commented 3 years ago

Have added an OnLog method and will see how it goes - is e.Data.Trim() sufficient?

swiftyspiffy commented 3 years ago

You should be able to just print e.Data I think? Unless you're concerned about bloat or something, then ya, Trim() should still work.

arricc commented 3 years ago

The prerelease does actually seem to be holding up in my last few streams - one of which was 8 hours.

swiftyspiffy commented 3 years ago

Glad to hear it (sorry about the delay). Will close this. Feel free to reopen if necessary.