Skip to content

fix: workerd last-event-id encoding - #370

Merged
rexxars merged 2 commits into
mainfrom
fix/utf8-last-event-id-workerd-webkit
Oct 13, 2026
Merged

rexxars merged 2 commits into
mainfrom
fix/utf8-last-event-id-workerd-webkit

Conversation

@rexxars

@rexxars rexxars commented Oct 13, 2026

Copy link
Copy Markdown
Member

workerd handles outgoing headers incorrectly: cloudflare/workerd#7734

This PR attempts to fix this by passing the bytes verbatim if user agent tells us we're on cloudflare workers.

Also documents utf-8 last-event-id limitation on webkit: there's no way (that I've found) to make the bytes received by the server end up correctly sent. I'm creating an issue for this in the webkit bug tracker.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The targeted workaround is covered across native and custom fetch paths, with affected runtime limitations documented.

0 open findings

What changed in this PR

Fixes double-encoding of non-ASCII Last-Event-ID values in Cloudflare Workers while documenting WebKit limitations.

Changes:

  • Passes Unicode IDs directly to workerd’s native fetch.
  • Expands UTF-8 reconnection tests and WebKit-specific handling.
  • Documents runtime limitations and release impact.
File Description
src/​EventSource.ts Adds workerd-specific header handling.
test/​client.test.ts Expands Unicode ID coverage.
test/​helpers/​env.ts Exposes WebKit test context.
vitest.browser.config.ts Identifies Playwright WebKit tests.
vitest.ios.config.ts Identifies iOS Safari tests.
README.md Documents WebKit and Workers behavior.
CONTRIBUTING.md Documents runtime-test policy.
.changeset/​fix-workerd-event-id-encoding.md Records the patch release change.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@rexxars
rexxars merged commit c866ce6 into main Oct 13, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants