twitchdev / issues

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

"users/blocks" service corruption #639

Closed Durss closed 2 years ago

Durss commented 2 years ago

Brief description When providing the helix/users/blocks endpoint with wrong user ID in the target_user_id (PUT method), it corrupts the GET endpoint resulting in a 500.

How to reproduce Call the endpoint helix/users/blocks in PUT with target_user_id=blablabla. (i get a 200 as if everything went fine) Call the endpoint helix/users/blocks in GET, you'll get a 500. To make the service back we need to call the endpoint with DELETE method and the exact same wrong target_user_id provided before. Only then the GET endpoint will work again. If, like I, you forgot which wrong data you sent before, you basically cannot get the service working back.

Expected behavior Calling the endpoint with a wrong user ID should yield an error.

Screenshots - none -

Additional context or questions - none -

jbulava commented 2 years ago

Team confirmed this has been fixed.

Durss commented 1 year ago

Bumping this up, as it seems like I managed to corrupt it again 😬

Not 100% sure about it, but, I think I sent a local UUID of my app instead of an actual user ID. I sent something like this for the ID : 427acf39-21dc-4a5f-b6dd-bbfd5456a41d

I got no error from the server.

Here is a reproduction case that gives no error when it should, and probably is the source of the service corruption.

fetch("https://api.twitch.tv/helix/users/blocks?target_user_id=427acf39-21dc-4a5f-b6dd-bbfd5456a41d", {
  "headers": {
    "authorization": "Bearer {BEARER_TOKEN}",
    "client-id": "{YOUR_CLIENT_ID}",
    "content-type": "application/json",
  },
  "body": null,
  "method": "PUT",
});