fix: FDv2 - Support dynamic reconnect URL for streaming. Handle 'error' event types for SSE.#1252
fix: FDv2 - Support dynamic reconnect URL for streaming. Handle 'error' event types for SSE.#1252kinyoklion wants to merge 2 commits intomainfrom
Conversation
- Add start:headless script for running contract test entity without auto-opening a browser window - Handle top-level dataSystem initializers/synchronizers in the contract test entity by wrapping them into a streaming connection mode - Fix browser EventSource onerror firing for server-sent "error" SSE events by checking for MessageEvent instances - Add urlBuilder to EventSourceInitDict so the browser EventSource can refresh the URL (including basis param) on reconnection - Pass buildStreamUri as urlBuilder in StreamingFDv2Base
|
@launchdarkly/js-sdk-common size report |
| "scripts": { | ||
| "install-playwright-browsers": "playwright install --with-deps chromium", | ||
| "start": "tsc --noEmit && vite --open=true", | ||
| "start:headless": "tsc --noEmit && vite", |
There was a problem hiding this comment.
Helper for LLMs to run contract tests.
|
@launchdarkly/browser size report |
|
@launchdarkly/js-client-sdk size report |
|
@launchdarkly/js-client-sdk-common size report |
Change SummaryThis PR fixes the browser SDK to pass FDv2 contract tests. Here's what each change does:
|
There was a problem hiding this comment.
The jank in here may be temporary as @tanderson-ld and @aaron-zeisler are adjusting the tests.
|
bugbot review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit fdf83b0. Configure here.
Note
Medium Risk
Changes streaming reconnection behavior and browser SSE error handling, which could affect connection stability and update delivery if the new URL-building or error classification is incorrect. Scope is limited to streaming/EventSource plumbing plus contract-test config tweaks.
Overview
Improves FDv2 streaming reconnect behavior by adding an optional
urlBuildertoEventSourceInitDictand wiring FDv2 streaming to rebuild the stream URL (including dynamic query params likebasis) on each reconnect attempt.Updates the browser
DefaultBrowserEventSourceto useurlBuilderwhen reopening connections and to ignore server-sent SSEevent: errormessages inonerror(treating them as non-connection failures).Contract-test tooling is adjusted to better support Data System configs without explicit connection modes (wrapping top-level initializers/synchronizers into a single
streamingmode), plus minor repo hygiene (.mcp.jsonignored; addsstart:headlessscript).Reviewed by Cursor Bugbot for commit fdf83b0. Bugbot is set up for automated code reviews on this repo. Configure here.