Skip to content

SSE Retries without Last-Event-ID Header #184

@azdle

Description

@azdle

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions