Skip to content

test: declare client-prereq-cycle-detection capability in wrappers#1823

Merged
tanderson-ld merged 1 commit into
mainfrom
ta/SDK-2711-2715-wrapper-cycle-detection
Jul 23, 2026
Merged

test: declare client-prereq-cycle-detection capability in wrappers#1823
tanderson-ld merged 1 commit into
mainfrom
ta/SDK-2711-2715-wrapper-cycle-detection

Conversation

@tanderson-ld

@tanderson-ld tanderson-ld commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds the client-prereq-cycle-detection capability to each wrapper's contract-test service so the sdk-test-harness exercises cycle scenarios against them. This closes the wrapper subtasks under the parent cycle-protection effort.

Tracker: SDK-2711 (React), SDK-2712 (React Native), SDK-2713 (Electron), SDK-2714 (Node client), SDK-2715 (Vue). Parent: SDK-2695.

Context

The defensive prerequisite-cycle guard lives in the shared @launchdarkly/js-client-sdk-common package. It shipped as v1.30.0 in release #1805 (merged 2026-07-21), which cascaded fresh releases to every wrapper that depends on it:

Package Version Depends on
@launchdarkly/js-client-sdk-common 1.30.0 — (contains the fix)
@launchdarkly/js-client-sdk 4.9.2 js-client-sdk-common 1.30.0
@launchdarkly/node-client-sdk 0.4.2 js-client-sdk-common 1.30.0
@launchdarkly/react-native-client-sdk 10.19.2 js-client-sdk-common 1.30.0
@launchdarkly/react-sdk 4.1.6 js-client-sdk 4.9.2 → 1.30.0
@launchdarkly/vue-client-sdk 0.1.2 js-client-sdk 4.9.2 → 1.30.0

Users installing the latest wrapper from npm get the cycle-guarded shared library transitively, so no dependency bumps are needed in this PR — release-please's node-workspace plugin already handled the cascade. @launchdarkly/electron-client-sdk is pre-release (0.0.1, unpublished); when it first publishes, its workspace:^ reference resolves to the current shared version.

Each wrapper's variation() is a direct passthrough to the shared LDClientImpl, so the guard flows through unchanged. Wrappers only need to declare the harness capability so the matching contract tests activate.

Changes

Four one-line additions, one per wrapper contract-test service:

  • packages/sdk/react/contract-tests/app/TestHarnessWebSocket.ts
  • packages/sdk/react-native/contract-tests/entity/src/TestHarnessWebSocket.ts
  • packages/sdk/electron/contract-tests/entity/src/main.ts
  • packages/sdk/node-client/contract-tests/src/index.ts

Vue is omitted intentionally: its wrapper package has no contract-test service (jest-only unit tests). Its coverage is provided algorithmically by the shared library.

Test plan

  • yarn install clean.
  • Topological builds (all 5 wrappers + shared deps) clean.
  • Unit tests: react 208/208, react-native 85/85, electron 215/215, node-client 144/144, vue 81/81.
  • Lint clean across all 5 (node-client has pre-existing warnings, 0 errors).
  • node-client contract tests: 888 total, 15 skipped, 873 ran, all passed — including every events/summary events/prerequisites/handles cycles/* and events/prerequisite events handle cycles/* scenario.
  • react / electron contract tests: will run in CI (require Playwright / Electron binaries not installed locally).
  • react-native contract tests: will run in CI (require Android emulator + adb).

Note

Low Risk
Test-harness capability strings only; no production SDK or evaluation logic changes.

Overview
Adds client-prereq-cycle-detection to the capability lists returned by the React, React Native, Electron, and Node client contract-test services so the sdk-test-harness runs prerequisite cycle scenarios against those wrappers.

This is harness metadata only; cycle handling remains in shared @launchdarkly/js-client-sdk-common. Vue is unchanged (no contract-test service).

Reviewed by Cursor Bugbot for commit d1bceb0. Bugbot is set up for automated code reviews on this repo. Configure here.

Adds the `client-prereq-cycle-detection` capability to each wrapper's
contract-test service so the sdk-test-harness exercises cycle scenarios
against them. Covers react, react-native, electron, and node-client;
vue has no contract-test service (jest-only), so nothing to declare.

The defensive cycle guard itself lives in the shared
@launchdarkly/js-client-sdk-common package (v1.30.0), which every
wrapper already depends on. Each wrapper's variation() is a direct
passthrough to the shared LDClientImpl, so no wrapper-specific code
changes are needed.
@github-actions

Copy link
Copy Markdown
Contributor

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 26360 bytes
Compressed size limit: 29000
Uncompressed size: 129188 bytes

@github-actions

Copy link
Copy Markdown
Contributor

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Compressed size: 32077 bytes
Compressed size limit: 34000
Uncompressed size: 114525 bytes

@github-actions

Copy link
Copy Markdown
Contributor

@launchdarkly/js-client-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 39108 bytes
Compressed size limit: 39300
Uncompressed size: 213642 bytes

@github-actions

Copy link
Copy Markdown
Contributor

@launchdarkly/browser size report
This is the brotli compressed size of the ESM build.
Compressed size: 179691 bytes
Compressed size limit: 200000
Uncompressed size: 831704 bytes

@tanderson-ld
tanderson-ld marked this pull request as ready for review July 23, 2026 14:27
@tanderson-ld
tanderson-ld requested a review from a team as a code owner July 23, 2026 14:27
@tanderson-ld
tanderson-ld merged commit 32523b1 into main Jul 23, 2026
60 checks passed
@tanderson-ld
tanderson-ld deleted the ta/SDK-2711-2715-wrapper-cycle-detection branch July 23, 2026 14:50
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