Fork me on GitHub
#pedestal
<
2018-09-07
>
orestis13:09:40

I’m seeing some really weird behaviour with io.pedestal.http/transit-json-body and family of interceptors:

< Content-Type: application/transit+json;charset=UTF-8
< Transfer-Encoding: chunked
<
* Connection #0 to host localhost left intact
["~#list",[["^ ","~:_created","~m1421289895000","~:_id"⏎

orestis13:09:06

The response should be around 250 entries, but instead it seems like the transit encoder stops after a few bytes.

orestis13:09:10

This is the handler:

(defn get-sites [req]
  (let [db (database/get-connection)
        sites (mc/find-maps db "sites")]
    (ring-resp/response sites)))
— I can verify that sites contains all the data, and if I use instead edn-response I get everything.

orestis13:09:36

The route is composed this way:

["/sites" :get (conj [http/transit-json-body] `get-sites) :route-name :sites-get]

orestis13:09:34

I thought it might be some lazy thing since monger returns a lazy-seq, but even wrapping it with vec makes no difference.

orestis13:09:18

Ooh I have to extend json/transit to handle mongo’s ObjectIds. Hmmm