Skip to content

fix: snapshot caller-owned URL objects - #372

Merged
rexxars merged 2 commits into
EventSource:mainfrom
edsonsims:fix/snapshot-url-object
Oct 28, 2026
Merged

rexxars merged 2 commits into
EventSource:mainfrom
edsonsims:fix/snapshot-url-object

Conversation

@edsonsims

Copy link
Copy Markdown
Contributor

Passing a URL instance retains the caller's mutable object. Changing its path or query after construction changes EventSource.url and the next reconnection target, even though the initial request used the original URL.

I copy that URL during construction. This keeps the initial URL record stable, consistent with the EventSource constructor and URL getter. The existing string, redirect and custom-fetch paths retain their handling. Two real-HTTP regressions cover the exposed URL and reconnection destination; both fail against the original source.

Validation on Node 24.19.0/macOS arm64:

  • Node: 75 passed, 1 skipped; build, public types, lint and formatting pass.
  • Chromium: 76 passed. WebKit: 72 passed, 4 existing skips.
  • Happy DOM: 72 passed, 4 existing expected failures. Workerd: 68 passed, 7 existing expected failures, 1 skip in a sequential full run.
  • An owned loopback probe confirms that changing the original object's path/query no longer changes either request destination.

Firefox could not launch locally (Could not find profile folder), so no Firefox test result is claimed. Bun, Deno and iOS were not run.

Comment thread src/EventSource.ts Outdated
@rexxars
rexxars merged commit 0769591 into EventSource:main Oct 28, 2026
1 check passed
@rexxars

rexxars commented Oct 28, 2026

Copy link
Copy Markdown
Member

Thank you for finding and fixing the issue!

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