Skip to content

Clear a stale Last-Event-ID header when the event ID is reset - #13140

Open
JinDX wants to merge 1 commit into
whatwg:mainfrom
JinDX:fix/eventsource-clear-last-event-id
Open

JinDX wants to merge 1 commit into
whatwg:mainfrom
JinDX:fix/eventsource-clear-last-event-id

Conversation

@JinDX

@JinDX JinDX commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

Delete Last-Event-ID from the reused EventSource request when the last event ID string is empty. Add the Fetch header-list delete reference used by the new step.

After one reconnect has set this header, a later empty id field resets the EventSource state but currently leaves the old header on the saved request. A subsequent reconnect can therefore send the stale value, contrary to the reset example in this section.

Suggested regression coverage: receive id: 1, reconnect, receive an empty id field, then verify the next request omits Last-Event-ID.

Spec: https://html.spec.whatwg.org/multipage/server-sent-events.html#reestablish-the-connection

  • At least two implementers are interested (and none opposed):
    • …
    • …
  • Tests are written and can be reviewed and commented upon at:
    • …
  • Implementation bugs are filed:
    • Chromium: …
    • Gecko: …
    • WebKit: …
    • Deno (only for timers, structured clone, base64 utils, channel messaging, module resolution, web workers, and web storage): …
    • Node.js (only for timers, structured clone, base64 utils, channel messaging, and module resolution): …
  • Corresponding HTML AAM & ARIA in HTML issues & PRs:
  • MDN issue is filed: …
  • The top of this comment includes a clear commit message to use.

(See WHATWG Working Mode: Changes for more details.)


/infrastructure.html ( diff )
/server-sent-events.html ( diff )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant