David
David
We need to block somehow 🤔
The original code doesn't appear to do anything: ``` @Test fun `testing SSE`() { JavalinTest.captureLogs = false JavalinTest.test(KotlinApp.app) { server, client -> val listOfEvents = mutableListOf() val (newClient, eventSource) =...
Aaah, now I see why you were reusing the `JavaApp` and `KotlinApp`
Sorry, my mind was elsewhere 😓
> Found another thing we must take into account: should we leak onFailure event to the client's thread? Probably. I can't figure out why Javalin won't shut down.
If I add `sseClient.close()` to the endpoint, Javalin shuts down as expected. But I created a new `println("isOpen:" + sseClient.isOpen())`, which reports that the emitter is closed.
I think this is a bug in Javalin (@dzikoysk ?). If I add `closeSse.close()` after `closeCallback.run()` inside of `SseClient`, it behaves as expected.
That only helps if we try to send a message though, we currently don't detect if the client disconnects.
@unoexperto could you provide a PR for what you're thinking here?
I don't see the immediate value, but feel free to submit a proposal!