When attempting to call get_users_by_id(), the call fails with a 400 error. This is due to a bug in the underlying get_users() function, which attempts to get the first ID value from the names array rather than ids, resulting in a request that looks like this:
GET /helix/users/?id=<null>&id=000000000
(where the second id= is the first element in the ids array)
Steps to Reproduce
Create a TwitchAPIConnection and call get_users_by_id() with an array containing at least one valid id.
Expected Behavior
The call should succeed and return information on the user.
Actual Behavior
The call returns an empty response due to a 400 error.
The fix is pretty simple - just change line 92 of api_connection.gd to call ids.pop_back() rather than names.pop_back().
Issue Summary
When attempting to call
get_users_by_id()
, the call fails with a 400 error. This is due to a bug in the underlyingget_users()
function, which attempts to get the first ID value from thenames
array rather thanids
, resulting in a request that looks like this:(where the second
id=
is the first element in theids
array)Steps to Reproduce
Create a
TwitchAPIConnection
and callget_users_by_id()
with an array containing at least one valid id.Expected Behavior
The call should succeed and return information on the user.
Actual Behavior
The call returns an empty response due to a 400 error.
The fix is pretty simple - just change line 92 of api_connection.gd to call
ids.pop_back()
rather thannames.pop_back()
.