[BUG] /Streams returning a bad next link

The /streams endpoint is periodically sending a bad next cursor for the /streams endpoint. No direct repro available as it happens when iterating over the next cursor for the following request. One occurrence happened at offset 2400, another occurrence happened at offset 500

https://api.twitch.tv/kraken/streams?game=&limit=100&offset=0

The logic I’m using iterates over each offset in incrementing batches (0, 100, 200, 300, etc) until no additional streams are found (the streams array is empty). It then goes into a forced sleep until a period of time has elapsed.

Instead of getting the expected return results, I received the following:

https://api.twitch.tv/kraken/streams?game=&max_height=-1&limit=100&offset=600&stream_type=live

which returned no results and broke the scan iterating over the next cursor.

Any ideas what happened, and how we can fix it to never happen again? :smiley:

Is this happening when you get to the end of the list? Curious if this is some weird edge case.

No, it’s occurring in the middle of the list (though the changed url returns no results, so becomes the end of the list for that iteration)

The first occurrence happened at offset 2500, and the second occurrence happened at offset 600 (so offset 0-2400 worked as expected, and 0-500 worked as expected)

To note, it also fixed itself between the two error scans, where it got a full good scan done (~15000 offset max, but this changes on the time of day, usually around 11000-24000)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.