This is a little weird. I have one app with :spec
coercion, but I get these message when logging: `
2018-08-21 07:48:58,805 [main] INFO [compojure.api.coercion.schema] - :schema coercion enabled in compojure.api
2018-08-21 07:48:59,218 [main] INFO [compojure.api.coercion.spec] - :spec coercion enabled in compojure.api
the weird one being the :schema coercion message
I'm still struggling with this. I'm guessing it isn't compojure-api, though the fact remains that while my endpoint is invoked and the response returned from my GET form, the client can never read the response. I built a standalone software project with all the same dependencies to also return an sse channel response, and that worked, so clearly compojure-api works with the as-channel
response. But in my production app the clients, any client, can't read the response. They connect, but not enough gets flushed for them to read the response (e.g. :status), and so they hang. Checking stale build artifacts now, every so often lein does stuff wrong, we'll see what happens.
I have a workaround. If I transmit, from the server, any text to the SSE channel, then the client gets a response and all things work well. As this is an SSE channel I can just send a comment. But in the standalone app I tested with the same dependencies it was not necessary, and should not be necessary. Somehow there seems to be something conditional going on up the stack from the GET return that decides what gets flushed and when. It's returning a chunked response, perhaps it should not be returning a chunked response. Still a mystery but I have a workaround for now.
there is a multimethod that is used to map Keyword :coercion
values, e.g. :coercion :schema
. The logging was added before Clojure 1.9.0 to indicate which coercion implementations are available (e.g. if spec is found in classpath). I think the logging can be removed, as 1.9.0 has shipped.
Pull Request to remove those most welcome.
oh, yes, c-api generates that when requested
yeah I didn’t understand that at all, it might be helpful to explain that to users when they’re just starting out so they aren’t searching for something that will never exist 😄