Closed Xemdo closed 4 months ago
Ticketed internally as APIPLAT-4685
This may be related to the similar inconsistency with handling certain user id's in other endpoints (for example, any user id that is numerically >= 2^31). So for example Get Users will return an empty data array for 2147483647
, but 2147483648
or higher returns a 400 error with the message Invalid username(s), email(s), or ID(s). Bad Identifiers.
.
Other endpoints handle such user id's differently, for example Get Streams just returns an empty data array as if the users stream isn't live, even if the user_id
is malformed. In this case of Delete Chat Message it returns a 500, which IIRC some other endpoints also do but I'd have to test.
So how bad user id's are handled differ depending on which endpoint is used.
In this case it doesn't appear to fail due to failure to parse as a 32-bit integer, as changing it to a User ID that doesn't exist below 2147483648 still returns 500:
twitch api delete moderation/chat -q broadcaster_id="2000000000" -q moderator_id=57047445 -q message_id="0b9a0b82-83ce-4fd4-8dc7-3c792898501b"
{
"data": [],
"error": "Internal Server Error",
"status": 500
}
Returning 400 on other endpoints due to that reason is interesting, though, and definitely needs some investigation for future-proofing.
Fixed.
When running Delete Chat Messages, if you put in a broadcaster_id that does not exist it returns 500:
Not working (message_id as broadcaster_id):
Not working (standard user id, doesn't exist):
Working: