Repository navigation
test: Add a browser contract test service that uses the HTTP SSE client - #360
Conversation
6dd55ca to
458d103
Compare
dd2985a to
84ee448
Compare
ce1d5df to
68dc044
Compare
There was a problem hiding this comment.
Risk: medium.
Automated risk review (dry run): Medium
This PR would not be automatically approved. Human approval required.
Why: The diff changes .github/workflows/ci.yml (CI workflow definitions are never Low) and adds a browser contract-test harness; Cursor Bugbot also completed unsuccessfully with an unresolved finding. Human review is needed and no reviewers were assigned.
If you disagree with this review, share this PR in #feedback-agent-approvals or submit a changes-requested review explaining why.
Sent by Cursor Approval Agent: Dry-Run PR Approver
a80f522 to
1c3da1e
Compare
There was a problem hiding this comment.
Risk: medium. Not approved (Rule 3: Approve only allowed workflow changes). This PR adds a new browser-contract-tests job in .github/workflows/ci.yml, which is more than an action or runtime version bump; Cursor Bugbot also completed unsuccessfully with an unresolved finding. Human review is needed and no reviewers were assigned.
Sent by Cursor Approval Agent: SDK - Pull Request Router and Approver
1c3da1e to
dd7583e
Compare
There was a problem hiding this comment.
Risk: medium. Not approved (Rule 3: Approve only allowed workflow changes). This PR adds a new browser-contract-tests job in .github/workflows/ci.yml, which is more than an action or runtime version bump, and the change is above the low-risk approval threshold. Human review is needed and no reviewers were assigned.
Sent by Cursor Approval Agent: SDK - Pull Request Router and Approver
dd7583e to
310249c
Compare
There was a problem hiding this comment.
Risk: medium. Not approved (Rule 3: Approve only allowed workflow changes). This PR adds a new browser-contract-tests job in .github/workflows/ci.yml, which is more than an action or runtime version bump, and it is above the low-risk approval threshold. Human review is needed and no reviewers were assigned.
Sent by Cursor Approval Agent: SDK - Pull Request Router and Approver
e33b189 to
78fe223
Compare
…ith application tags
…ean up Chrome on exit
…me exits and free the port on shutdown
…fo in the browser contract service
Generated-by: termag
…e harness asks for them
78fe223 to
3cf5c33
Compare
<!-- TERMAG_PR_BODY_BEGIN --> ## Summary On web, the default diagnostic events path was the analytics path, so diagnostic events were posted to `/events/bulk/<credential>`. It is now `/events/diagnostic/<credential>`, matching the JS browser SDK. PR #380 fixed the event processor URI choice but left this path wrong. The browser contract service now declares the `diagnostic-events` capability, so the v3 harness runs the new `events/diagnostic events` test against it. Stacked on #360, which adds the browser contract service this PR extends. <!-- TERMAG_PR_BODY_END --> <!-- termag: box=i-0a22178dd5f8d553f project=launchdarkly task=fix --> <sub>Opened from termag</sub> <!-- devin-review-badge-begin --> --- <a href="https://app.devin.ai/review/launchdarkly/flutter-client-sdk/pull/414" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-devin-review-dark.svg?v=4"><img src="https://static.devin.ai/assets/gh-devin-review-light.svg?v=4" alt="Devin Review"></picture></a> <!-- devin-review-badge-end --> <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Overview** > **Web clients** were posting diagnostic events to the analytics bulk URL (`/events/bulk/<credential>`) because `DefaultEventPaths.getDiagnosticEventsPath` in `js_config.dart` matched the analytics path. It now returns **`/events/diagnostic/<credential>`**, aligning with the JS browser SDK (and fixing the gap left after PR #380’s URI selection work). > > The **Flutter web contract test service** advertises the **`diagnostic-events`** capability so the v3 harness can run the diagnostic events contract test against the browser adapter. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit d61e3c3. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->


Summary
apps/flutter_web_contract_test_service, a contract test service that runs the Flutter SDK in headless Chrome. The SDK streams with the HTTP-based SSE client througheventSource: SSEClient.http. The browser nativeEventSourcecannot send a request body or report an HTTP error. This is the only contract test run that coversusePostand HTTP error handling for streaming on web.bin/adapter.dartruns on the Dart VM, serves the REST API, starts Chrome, and relays each request to a Flutter web app over a websocket. The same design is used by the JS browser SDK contract tests.client-use-postandclient-event-source-http-errorsbecause it always uses the HTTP-based SSE client. It also declarescontext-typeandpolling-gzip, which pass on web.browser-contract-teststo the CI workflow (FDv1 and FDv2 runs), and theclient-web-contract-testsandclient-web-contract-tests-fdv2melos scripts.kind: nullcontext type test, as the existing Flutter service does.Notes
auto-env-attributesis not declared, as in the JS browser SDK. Hooks are not mapped yet.lib/src/entity.dartrepeats code from the existing service. That service uses generated types that needdart:io, so it cannot share them yet.Note
Overview
Adds
apps/flutter_web_contract_test_service, a new contract-test path that runs the Flutter client SDK in headless Chrome witheventSource: SSEClient.http, so harness coverage includesusePostand HTTP streaming error behavior that the native browserEventSourcecannot exercise.The harness still speaks REST, so a VM adapter (
bin/adapter.dart) exposes the REST API, serves the web build, launches Chrome, and relays requests over a WebSocket to a minimal Flutter web entity (lib/main.dart/lib/src/entity.dart) that runs the SDK and reports capabilities includingclient-use-postandclient-event-source-http-errors.CI gains a
browser-contract-testsjob (FDv1 v2 and FDv2 v3 harness runs, adapter restart between suites, adapter log artifacts).melos.yamladdsclient-web-contract-testsandclient-web-contract-tests-fdv2. FDv1/FDv2 suppression lists document web/CORS/tag differences vs the JS browser SDK lists. The existing VM contract service README documents how to run the harness locally.Reviewed by Cursor Bugbot for commit 3cf5c33. Bugbot is set up for automated code reviews on this repo. Configure here.