twitchdev / issues

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

Mod state desynchronization after message passes through after timeout #209

Open TETYYS opened 4 years ago

TETYYS commented 4 years ago

Brief description If a broadcaster applies a timeout to a moderator (nam_nam_bot in this case as an example) while he's sending many messages in a chat, some messages can appear after timeout is applied. This leads to strange behavior regarding /mods command - moderator status should be removed after a user is timed out, but in this case, moderator status stays. /mods command says that user is not a moderator and pubsub reports to the moderator that he has been unmodded.

Using /unmod results in a similar state at the end, but instead of receiving one or two messages after /unmod is done, /unmod sometimes just doesn't work while moderator is sending the messages (although you do receive You have removed NaM_NaM_BOT as a moderator of this channel.)

  1. /mods doesn't return nam_nam_bot as moderator after this
  2. Writing /mod nam_nam_bot says NaM_NaM_BOT is already a moderator of this channel.
  3. Writing /unmod nam_nam_bot after that says NaM_NaM_BOT is not a moderator of this channel.
  4. Writing /mod nam_nam_bot again says You have added NaM_NaM_BOT as a moderator of this channel.
  5. At this point /mods returns correct information

Here's the raw TMI traffic of when the message is received after timeout, doesn't include the steps mentioned above:

@badge-info=;badges=moderator/1;color=#00FF7F;display-name=NaM_NaM_BOT;emotes=;flags=;id=ae6245d3-fb85-40de-8eb1-bac80c58ffc6;mod=1;room-id=36175310;subscriber=0;tmi-sent-ts=1598557367468;turbo=0;user-id=258811155;user-type=mod :nam_nam_bot!nam_nam_bot@nam_nam_bot.tmi.twitch.tv PRIVMSG #tetyys :85
@badge-info=;badges=moderator/1;color=#00FF7F;display-name=NaM_NaM_BOT;emotes=;flags=;id=72f01a45-3185-46f4-bd8a-37150165e6f8;mod=1;room-id=36175310;subscriber=0;tmi-sent-ts=1598557367459;turbo=0;user-id=258811155;user-type=mod :nam_nam_bot!nam_nam_bot@nam_nam_bot.tmi.twitch.tv PRIVMSG #tetyys :72
@ban-duration=5;room-id=36175310;target-user-id=258811155;tmi-sent-ts=1598557367556 :tmi.twitch.tv CLEARCHAT #tetyys :nam_nam_bot
@badge-info=;badges=moderator/1;color=#00FF7F;display-name=NaM_NaM_BOT;emotes=;flags=;id=e1892218-f801-4995-8c6a-6ae931fef631;mod=1;room-id=36175310;subscriber=0;tmi-sent-ts=1598557367496;turbo=0;user-id=258811155;user-type=mod :nam_nam_bot!nam_nam_bot@nam_nam_bot.tmi.twitch.tv PRIVMSG #tetyys :68
@badge-info=;badges=moderator/1;color=#00FF7F;display-name=NaM_NaM_BOT;emotes=;flags=;id=c8ef5fdc-4401-427d-a011-024befa048e3;mod=1;room-id=36175310;subscriber=0;tmi-sent-ts=1598557367470;turbo=0;user-id=258811155;user-type=mod :nam_nam_bot!nam_nam_bot@nam_nam_bot.tmi.twitch.tv PRIVMSG #tetyys :79
@badge-info=;badges=moderator/1;color=#00FF7F;display-name=NaM_NaM_BOT;emote-only=1;emotes=120232:0-6;flags=;id=b4095db0-8510-4581-a930-00ac1c40ef1e;mod=1;room-id=36175310;subscriber=0;tmi-sent-ts=1598557620322;turbo=0;user-id=258811155;user-type=mod :nam_nam_bot!nam_nam_bot@nam_nam_bot.tmi.twitch.tv PRIVMSG #tetyys :TriHard

How to reproduce

  1. Mod user1
  2. Set up a couple connections to prepare to write many messages in chat using user1
  3. While user1 is writing the messages, time him out for a couple of seconds as a broadcaster
  4. If you're lucky, one or more messages will appear after user1 CLEARCHAT message is received
  5. /mods and actual moderation status desynchronization

Expected behavior

User is unmodded after he's timed out, despite receiving messages after CLEARCHAT is received OR User can't write messages after being timed out, no matter how fast he does it

Screenshots PaintDotNet_Z83BlNcV2L (as seen in Chatterino2, first gray message is from TMI, second one is from pubsub) chatterino_90KNQSYjOa (as seen in Chatterino2)

Additional context or questions It was a known fact that you could write a message after you are timed out, even if you're not a fast-writing moderator, but I am not able to reproduce that anymore.

lleadbet commented 3 years ago

Ticketed internally as CHMOD-520.