Closed macabrus closed 10 months ago
I think we could document this better in https://docs.litestar.dev/latest/usage/responses.html#server-sent-event-responses and also include a link to the living standard for it (https://html.spec.whatwg.org/multipage/server-sent-events.html)
I think we should consider this a bug. It's very unintuitive and can be easily fixed by appending the newline if it's not already there :shrug:
Now that I think about this, it might be better if simply were to add a parameter that could configure this. Something like disable_client_buffering
?
@euri10 Iiuc your PR #2888 would fix this one as well, right?
@euri10 Iiuc your PR #2888 would fix this one as well, right?
yes i think so :)
Description
I am using Litestar on the backend, HTMX + Jinja2 for templating. I have following code:
and following event receiver in HTMX:
also tried
curl
ing:My issue is that i didn't explicitly end events with '\n' so browser was forever buffering them and not showing in event stream console (neither Safari nor Chrome). As I've learned, SSE should explicitly end in '\n\n' to prevent buffering behavior! Is this expected behaviour? It wasn't obvious for me at all and I suggest this to be in the docs.
URL to code causing the issue
No response
MCVE
No response
Steps to reproduce
No response
Screenshots
No response
Logs
Litestar Version
latest
Platform