Closed cancan101 closed 1 year ago
Hallo @cancan101 , thank you for your input.
Doing a quick scan of https://html.spec.whatwg.org/multipage/server-sent-events.html I could find no spec in this regard. Since the entire payload (including id) is sent as one byte chunk I am not sure whether this is adding any benefit.
If I missed something in hte spec then this needs to change, of course.
In any case, PRs wellcome.
Regards, sysid
I filed a comment upstream: https://github.com/javascript-tutorial/en.javascript.info/commit/027933531e121650120f7e8385f691de99af12d2#r113921611
the note on the linked doc might have been a misinterpretation of this comment from the spec:
The second block has two fields with names "data" and "id" respectively; an event will be fired for this block, with the data "first event", and will then set the last event ID to "1" so that if the connection died between this block and the next, the server would be sent a
[Last-Event-ID](https://html.spec.whatwg.org/multipage/server-sent-events.html#last-event-id)
header with the value1
.
Nothing to do here. Please reopen if needed.
https://javascript.info/server-sent-events makes a good point to:
However, that does not seem to be the case in the current implementation: https://github.com/sysid/sse-starlette/blob/8086dac07fc459252c127f89b8d8db5fcff65e39/sse_starlette/sse.py#L101-L112