twitchdev / issues

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

Moderators are not removed from /helix/moderation/moderators when timed out #823

Closed EthanBlaisAlarms closed 1 year ago

EthanBlaisAlarms commented 1 year ago

Brief description If a moderator is timed out, whether that is via the helix API or from Twitch itself, sending a request to /helix/moderation/moderators still returns their user information, even though they are not a moderator.

How to reproduce Time out a moderator, send a GET request to /helix/moderation/moderators, response body still includes their user ID, login name, and display name.

Expected behavior The timed-out user won't be included in the response body

Screenshots image

Additional context or questions Whenever a moderator is timed out, timing out another mod will actually remove them. image (The above screenshot was taken while the account "fireboy65442" was not a moderator. After also timing out one of my accounts, his account was removed from the response while mine still stayed.)

BarryCarlyon commented 1 year ago

I suspect caching is in play. It seems you did a timeout at 01:11:30 and then Instantly checked the Moderators API at 01:11:30

Recheck you test scenrio

By doing the timeout waiting a second or two and then checking Get Moderators.

I suspect that the interal systems had not percolated the moderator removal quite yet becuase you did "get moderators" too quickly after wacking the moderator based on the presented screenshot/timestamps

This smells of caching or "just too quick"

EthanBlaisAlarms commented 1 year ago

My script sends the request every 5 seconds (and temporarily prints the output to the console). During testing, it continued to return a timed-out moderator for at least 5 minutes after timing out (that's the longest time I ran the test), and likely much longer since I had a moderator get timed out by a chat game and several minutes later, could not be re-modded since the bot thought they were already modded. In addition, this does not happen if I unmod them instead of timing them out.

A temporary workaround that is working is that I have the bot send an unmod request whenever a user is timed out. That seems to properly work.

I also feel like this is a bug with Twitch because I later discovered that the timed-out mod still shows up as a mod in my Twitch creator dashboard. image

After doing that, I then go to my creator dashboard and... image

Still a moderator. Even after refreshing the page.

BarryCarlyon commented 1 year ago

So it looks like this is not an API bug (technically) but a first party issue. So the underlying service is at fault.

EthanBlaisAlarms commented 1 year ago

Yes, it does look like it's an issue with Twitch, not the API. Though it's still interesting because the moderator I timed out doesn't have moderation powers anymore, yet still appears as a mod in the creator dashboard, and continues to show like that for several minutes.

Not a mod: image

Apparently a mod: image

So, should I instead report this issue to Twitch?

Xemdo commented 1 year ago

Does this only occur when timing out using the API? I could not reproduce it while testing on my channel. My 2nd account was removed from both /moderation/moderators and the Roles Manager as soon as I timed it out.

EthanBlaisAlarms commented 1 year ago

As of right now, running the exact same code that caused the problem in the first place, I too am no longer able to replicate it. It might have been a bug on Twitch's end that has been patched. But at the moment, all seems to be working as intended.