api icon indicating copy to clipboard operation
api copied to clipboard

Searching for the parent_id of a top level comment results in a 500

Open ahammel opened this issue 5 years ago • 0 comments

The parent_id field of a comment response object is an ID in the format t3_{submission-id} (I think). If you feed this ID back into the ids parameter of the comment search route, you get an HTTP/500 error.

This is easily worked around, but it is a surprising result if you're trying to use a bot to climb a comment thread.

Steps to reproduce

  1. Perform a search for a top level comment by ID (/reddit/search/comment/?ids=base64id)
  2. Perform a search for the parent_id returned by the search in step 1. (/reddit/search/comment/?ids=parentIdFrom)

Expected result

HTTP/404 or similar

Actual result

HTTP/500

Live data demo using cURL

$ curl 'https://api.pushshift.io/reddit/search/comment/?fields=id,parent_id&ids=g4xy6go'
{
    "data": [
        {
            "id": "g4xy6go",
            "parent_id": "t3_irf8tz"
        }
    ]
}
$ curl 'https://api.pushshift.io/reddit/search/comment/?fields=id,parent_id&ids=t3_irf8tz'
<html>
  <head>
    <title>Internal Server Error</title>
  </head>
  <body>
    <h1><p>Internal Server Error</p></h1>

  </body>
</html>

ahammel avatar Sep 22 '20 17:09 ahammel