twitchdev / issues

Issue tracker for third party developers.
Apache License 2.0
72 stars 7 forks source link

Sending a chat message with an invalid `reply_parent_message_id` returns generic `msg_rejected` #896

Closed Nerixyz closed 5 months ago

Nerixyz commented 5 months ago

Brief description

Calling /chat/messages with an invalid reply-parent-id returns 200 OK:

{
  "data": [
    {
      "drop_reason": {
        "code": "msg_rejected",
        "message": "Your message is being checked by mods and has not been sent."
      },
      "is_sent": false,
      "message_id": ""
    }
  ]
}

While it's true that the message is dropped, the reason is too generic. I'd like to know that the reply_parent_message_id was invalid.

How to reproduce

Call the POST /chat/messages endpoint with

{"broadcaster_id": "<your-id>", "sender_id": "<your-id>", "message": "a", "reply_parent_message_id": "1"}

Expected behavior

It should return 400 or include a proper code and message in the drop_reason.

Xemdo commented 5 months ago

Internal ref: APIPLAT-4456

This was deemed to be a bug and should be fixed now. Will leave this open until someone can confirm it is fixed.

Nerixyz commented 5 months ago

Thanks! Returns 400 now:

{
  "data": [],
  "error": "Bad Request",
  "message": "The request's input was not valid. Message cannot be replied to.",
  "status": 400
}
Xemdo commented 5 months ago

Looks good! Closing this out