I develop a C# twitch library, and it was brought to my attention that the /follows endpoint seems to be returning relatively random/inconsistent 400 response codes.
The issue was originally discovered in a FollowerService class that pings the /follows endpoint on an interval and fires an event when new followers are discovered.
To test the user’s claim, I setup a separate application that pinged the /follows endpoint for playhearthstone at a 1 minute interval. Sometimes it 400’d on the first call, other times it’d take a few intervals, and other times it’d take 10-20 to 400.
Right, because the function that the service relies on is also used as a general call for pulling Twitch followers where the programmer may wish to specify a limit. The service itself does not use a limit, and it is my understanding 0 defaults to 25.
Edit:
But you’re right, it shouldn’t be a parameter, it serves no purpose. Though, it also shouldn’t lead to 400’s, I would think.
That’s the problem though, using a timer to replicate the call exactly the same each time, I get the error randomly. Sometimes the first time, sometimes the 15th time.
Edit:
It should be noted the call works a majority of the time (more than 90% of the time).
var request = (HttpWebRequest)WebRequest.Create(url);
?
I noticed with my own code that this sometimes had an issue with the client-id header, and a re-adding the header explicitly to the request after the .Create command helped reduce these errors to only being received during twitch deployment periods where various bits are in a weird state due to caching.
[Edit] Specifically, re-adding the Client-ID header after turning the WebRequest into the HttpWebRequest
The client id header is added directly tot he HttpWebRequest, so I should be good there. In addition, I pass it as a GET parameter to be safe (which I believe to be still valid).
Edit: post formatting, I accidentally linked GetFollowedUsers(), not GetTwitchFollowers(), sorry about that!
Getting the same here using the Twitch.tv Ruby gem. Doesn’t seem to be any pattern. Sending the same request again seems to work sometimes. The message says “Unparsable request body”.
Here’s the frequency/dates from our Bugsnag env on this error:
Also, if it helps at all, the problem was originally noticed 9 days ago. Initially I thought it was a library error, and it took me sometime to follow up on it. Here’s the original GitHub issue (has some images): TwitchLib issue regarding /follows
After I removed ContentType header from the call, I no longer get the error to the best of my knowledge. I don’t think Twitch’s fix has gone live yet (as Tourny said they were working on it), so I don’t think that fixed my problem.