bigskysoftware / bigskysoftware/htmx-extensions

SSE Retries without Last-Event-ID Header

Open
#184 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
284
Forks
88
PR merge metrics
No merged PRs in 30d

Description

When the browser retries an SSE connection it sets a `Last-Event-Id` header that contains the event ID of the last event it received. But when the the htmx sse extension retries the connection it doesn't set that header.

For me this ends up duplicating a bunch of messages because, to the server, the re-connection is indistinguishable from a full page reload or a new tab being opened which needs the event history.

As far as I know it's impossible to set any headers on the request generated by constructing a new EventSource. Is there some other way to prevent randomly getting duplicate events without also possibly missing some events?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.