twitchdev / issues

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

Add/Remove Blocked Terms quickly does not update terms correctly #557

Open tduva opened 2 years ago

tduva commented 2 years ago

Brief description This is about the API endpoints:

POST https://api.twitch.tv/helix/moderation/blocked_terms DELETE https://api.twitch.tv/helix/moderation/blocked_terms

When adding/removing several terms in quick succession, not all affected terms are updated correctly. Added terms don't show up in the list of terms, but also can't be added again. Deleted terms still show up in the list of terms, but they can be deleted when deleting them again.

How to reproduce (Copied from Forum Post) I’ve been seeing some issues with these endpoints with quick bulk edits. In the described cases the requests were basicially sent without delay, but nowhere near enough requests to get close to any rate limits (that I’m aware of, I check the Ratelimit-Remaining reponse header for every request).

When adding terms:

When deleting terms:

Adding a 500ms delay between requests seems to avoid the issue so far. Lower delays such as 100ms seemed to work as well, but I haven’t tested it as much.

(Copied from second Forum Post) I did another test yesterday around when I made my previous post and the missing terms hadn’t yet appeared until now. Trying to add the missing terms seemed to add them, but they didn’t actually appear in the list (as previously described).

Then I tried to delete the id of one of the missing terms after trying to add it again (as previously described, it does return the JSON, where I got the id from) to see if I could maybe then add it successfully again and not only did that apparently work, in addition several terms I must have added yesterday (but that were missing from the list) suddenly appeared. So deleting one of the missing terms must have flushed some sort of buffer or something that affected more than just the deleted one.

(At the time of opening this issue) Based some quick tests, the issue appears to be still occuring as described.

Expected behavior Terms should not be caught in some inbetween added and not added state.

serycodes commented 2 years ago

Just adding my two cents in.

I've observed something similar to this client side when deleting terms. A co-mod removed about 10 terms very quickly during a live stream (deleted through twitch.tv, not the API), but viewers still couldn't use a couple of the terms that we removed. They had to readd a couple of the terms back to blocked terms, then remove them again before the delete processed successfully. This bug may not be specific to the API implementation.