twitchdev / issues

Issue tracker for third party developers.
Apache License 2.0
73 stars 6 forks source link

End poll event appears twice on one poll if it was ended before full duration #749

Open nyaKawaiiiDesu opened 1 year ago

nyaKawaiiiDesu commented 1 year ago

Brief description Not sure if it's a bug. I'm using @twurple/eventsub-ws to listen for onChannelPollEnd and encountered a problem that actions does things twice. On status 'terminated' and status 'completed'(when remaining time of poll should end)

How to reproduce

  1. Use this code
    listener.onChannelPollEnd(channelid, (pollEnd) =>{
    console.log('poll ended');
    });
  2. Start poll using '/poll' with 1 minute duration in Twitch chat
  3. End poll using '/endpoll' in Twitch chat
  4. The first 'poll ended' should display instantly'
  5. Wait for 1 minute till second 'poll ended' appears Expected behavior 'poll ended' Should appears only once Screenshots

Additional context or questions Fixed with

if ((poEnd.status === `terminated`||poEnd.status === `completed`)){
        console.log('poll ended');
    };
BarryCarlyon commented 1 year ago

I ran your steps and was unable to replicate

I got a teminated as expected I did not get a completed I did get an archived

I did not get a completed in error

I checked this on Webhooks, Websockets, terminated via the API terminating via dashboard terminating via chat.