Skip to content

Conversation

@joker23
Copy link
Contributor

@joker23 joker23 commented Nov 25, 2025

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

Describe the solution you've provided

This PR will:

  1. Make it so that a client in FDv2 will only report intialized when it gets a basis + valid selector. This will align the behavior better with the FDv2 initializer specs.
  2. Updated the docs for the custom datasystem options with an example for clarity

Note

FDv2 now calls the initialization callback only when payload.state is non-empty, with tests added, and docs updated with an example for custom data source options.

  • Data sources:
    • In createPayloadListenerFDv2, replace basisReceived with initializedCallback and invoke it only when payload.state !== '' during applyChanges.
  • Tests:
    • Update createPayloadListenersFDv2.test.ts to use initializedCallback and assert conditional invocation for non-empty vs empty state; keep existing behavior checks for basis/updates.
  • Docs:
    • Expand JSDoc for CustomDataSourceOptions in LDDataSystemOptions.ts with @experimental note and a usage example mirroring default standard options.

Written by Cursor Bugbot for commit 38af523. This will update automatically on new commits. Configure here.

@joker23 joker23 requested a review from a team as a code owner November 25, 2025 22:03
@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 25394 bytes
Compressed size limit: 26000
Uncompressed size: 124693 bytes

@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Compressed size: 22101 bytes
Compressed size limit: 25000
Uncompressed size: 76263 bytes

// NOTE: this is a hack right now. The only condition that we will consider a valid basis
// is when there is a valid selector. Currently, the only data source that does not have a
// valid selector is the file data initializer, which will have a blank selector.
basisReceived();
Copy link
Member

Choose a reason for hiding this comment

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

Would the FDv2 fallback also not have a selector? I may just not know how that part works.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From my understanding here, the basis can be consumed without a selector, however that would not be considered a successful initialization from this particular initializer. I think this function might not be named correctly here as from the invocation it is simply a success callback (

payloadListener = createPayloadListener(dataSourceUpdates, logger, initSuccess);
). @tanderson-ld thoughts?

Copy link
Contributor

@tanderson-ld tanderson-ld Dec 8, 2025

Choose a reason for hiding this comment

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

I agree there is a bug in the code before this PR as even when payload.basis is false, basisReceived is called.

LDClientImpl is passing in a function called initSuccess. I think at that time I had thought getting a basis (independent of selector) was sufficient to consider it initialized. This would be my thinking at the time since I thought this code path was only hit when basis == true.

Since Casey's requirement is "Basis with a Payload Selector.", should this logic be updated to ensure basis is also true when selector is not null?

The name basisRecieved in basisReceived: VoidFunction = () => {} parameter may need to be adjusted.

@joker23 joker23 requested a review from tanderson-ld December 5, 2025 18:25
this commit also changes the initialization callback funciton to `initializedCallback` from `basisRecieved` to be more clear on what the callback is for.
@joker23 joker23 requested a review from kinyoklion December 8, 2025 16:08
@joker23 joker23 merged commit 7a3af02 into main Dec 9, 2025
36 checks passed
@joker23 joker23 deleted the skz/sdk-1645/intializer-spec branch December 9, 2025 14:50
@github-actions github-actions bot mentioned this pull request Dec 9, 2025
joker23 pushed a commit that referenced this pull request Dec 10, 2025
🤖 I have created a release *beep* *boop*
---


<details><summary>akamai-edgeworker-sdk-common: 2.0.12</summary>

##
[2.0.12](akamai-edgeworker-sdk-common-v2.0.11...akamai-edgeworker-sdk-common-v2.0.12)
(2025-12-09)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-server-sdk-common bumped from ^2.17.0 to ^2.17.1
</details>

<details><summary>akamai-server-base-sdk: 3.0.13</summary>

##
[3.0.13](akamai-server-base-sdk-v3.0.12...akamai-server-base-sdk-v3.0.13)
(2025-12-09)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
* @launchdarkly/akamai-edgeworker-sdk-common bumped from ^2.0.11 to
^2.0.12
    * @launchdarkly/js-server-sdk-common bumped from ^2.17.0 to ^2.17.1
</details>

<details><summary>akamai-server-edgekv-sdk: 1.4.15</summary>

##
[1.4.15](akamai-server-edgekv-sdk-v1.4.14...akamai-server-edgekv-sdk-v1.4.15)
(2025-12-09)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
* @launchdarkly/akamai-edgeworker-sdk-common bumped from ^2.0.11 to
^2.0.12
    * @launchdarkly/js-server-sdk-common bumped from ^2.17.0 to ^2.17.1
</details>

<details><summary>browser-telemetry: 1.0.14</summary>

##
[1.0.14](browser-telemetry-v1.0.13...browser-telemetry-v1.0.14)
(2025-12-09)


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @launchdarkly/js-client-sdk bumped from 0.9.1 to 0.10.0
</details>

<details><summary>cloudflare-server-sdk: 2.7.12</summary>

##
[2.7.12](cloudflare-server-sdk-v2.7.11...cloudflare-server-sdk-v2.7.12)
(2025-12-09)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
* @launchdarkly/js-server-sdk-common-edge bumped from 2.6.10 to 2.6.11
</details>

<details><summary>fastly-server-sdk: 0.2.4</summary>

##
[0.2.4](fastly-server-sdk-v0.2.3...fastly-server-sdk-v0.2.4)
(2025-12-09)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-server-sdk-common bumped from 2.17.0 to 2.17.1
</details>

<details><summary>js-client-sdk: 0.10.0</summary>

##
[0.10.0](js-client-sdk-v0.9.1...js-client-sdk-v0.10.0)
(2025-12-09)


### Features

* add initial polling retries to BrowserDataManager
([#1030](#1030))
([cd91013](cd91013))
</details>

<details><summary>js-server-sdk-common: 2.17.1</summary>

##
[2.17.1](js-server-sdk-common-v2.17.0...js-server-sdk-common-v2.17.1)
(2025-12-09)


### Bug Fixes

* FDv2 initializer readiness
([#1017](#1017))
([7a3af02](7a3af02))
</details>

<details><summary>js-server-sdk-common-edge: 2.6.11</summary>

##
[2.6.11](js-server-sdk-common-edge-v2.6.10...js-server-sdk-common-edge-v2.6.11)
(2025-12-09)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-server-sdk-common bumped from 2.17.0 to 2.17.1
</details>

<details><summary>node-server-sdk: 9.10.5</summary>

##
[9.10.5](node-server-sdk-v9.10.4...node-server-sdk-v9.10.5)
(2025-12-09)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-server-sdk-common bumped from 2.17.0 to 2.17.1
</details>

<details><summary>node-server-sdk-dynamodb: 6.2.17</summary>

##
[6.2.17](node-server-sdk-dynamodb-v6.2.16...node-server-sdk-dynamodb-v6.2.17)
(2025-12-09)


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @launchdarkly/node-server-sdk bumped from 9.10.4 to 9.10.5
  * peerDependencies
    * @launchdarkly/node-server-sdk bumped from >=9.4.3 to >=9.10.5
</details>

<details><summary>node-server-sdk-otel: 1.3.5</summary>

##
[1.3.5](node-server-sdk-otel-v1.3.4...node-server-sdk-otel-v1.3.5)
(2025-12-09)


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @launchdarkly/node-server-sdk bumped from 9.10.4 to 9.10.5
  * peerDependencies
    * @launchdarkly/node-server-sdk bumped from >=9.4.3 to >=9.10.5
</details>

<details><summary>node-server-sdk-redis: 4.2.17</summary>

##
[4.2.17](node-server-sdk-redis-v4.2.16...node-server-sdk-redis-v4.2.17)
(2025-12-09)


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @launchdarkly/node-server-sdk bumped from 9.10.4 to 9.10.5
  * peerDependencies
    * @launchdarkly/node-server-sdk bumped from >=9.4.3 to >=9.10.5
</details>

<details><summary>server-sdk-ai: 0.15.2</summary>

##
[0.15.2](server-sdk-ai-v0.15.1...server-sdk-ai-v0.15.2)
(2025-12-09)


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @launchdarkly/js-server-sdk-common bumped from 2.17.0 to 2.17.1
  * peerDependencies
    * @launchdarkly/js-server-sdk-common bumped from 2.x to 2.17.1
</details>

<details><summary>server-sdk-ai-langchain: 0.4.2</summary>

##
[0.4.2](server-sdk-ai-langchain-v0.4.1...server-sdk-ai-langchain-v0.4.2)
(2025-12-09)


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @launchdarkly/server-sdk-ai bumped from ^0.15.1 to ^0.15.2
  * peerDependencies
    * @launchdarkly/server-sdk-ai bumped from ^0.15.0 to ^0.15.2
</details>

<details><summary>server-sdk-ai-openai: 0.4.2</summary>

##
[0.4.2](server-sdk-ai-openai-v0.4.1...server-sdk-ai-openai-v0.4.2)
(2025-12-09)


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @launchdarkly/js-server-sdk-common bumped from 2.17.0 to 2.17.1
    * @launchdarkly/server-sdk-ai bumped from ^0.15.1 to ^0.15.2
  * peerDependencies
    * @launchdarkly/server-sdk-ai bumped from ^0.15.0 to ^0.15.2
</details>

<details><summary>server-sdk-ai-vercel: 0.4.2</summary>

##
[0.4.2](server-sdk-ai-vercel-v0.4.1...server-sdk-ai-vercel-v0.4.2)
(2025-12-09)


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @launchdarkly/server-sdk-ai bumped from ^0.15.1 to ^0.15.2
  * peerDependencies
    * @launchdarkly/server-sdk-ai bumped from ^0.15.0 to ^0.15.2
</details>

<details><summary>shopify-oxygen-sdk: 0.1.2</summary>

##
[0.1.2](shopify-oxygen-sdk-v0.1.1...shopify-oxygen-sdk-v0.1.2)
(2025-12-09)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-server-sdk-common bumped from 2.17.0 to 2.17.1
</details>

<details><summary>vercel-server-sdk: 1.3.37</summary>

##
[1.3.37](vercel-server-sdk-v1.3.36...vercel-server-sdk-v1.3.37)
(2025-12-09)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
* @launchdarkly/js-server-sdk-common-edge bumped from 2.6.10 to 2.6.11
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Cuts a release with a browser SDK feature and a core bug fix, plus
widespread version and dependency bumps across AI, server, edge,
telemetry, and store packages.
> 
> - **Features**
> - Browser SDK (`@launchdarkly/js-client-sdk`) `0.10.0`: add initial
polling retries.
> - **Bug Fixes**
> - Core server common (`@launchdarkly/js-server-sdk-common`) `2.17.1`:
FDv2 initializer readiness.
> - **Ecosystem Updates** (versions and embedded `sdkVersion` constants)
> - **AI**: `@launchdarkly/server-sdk-ai` → `0.15.2`; providers
(`langchain`, `openai`, `vercel`) → `0.4.2` with peer/dev dep bumps.
> - **Server/Edge SDKs**: Node `9.10.5`; Cloudflare `2.7.12` (edge
common `2.6.11`); Vercel `1.3.37`; Fastly `0.2.4`; Akamai base `3.0.13`
and EdgeKV `1.4.15`.
> - **Shared**: Edgeworker common `2.0.12`; Edge common `2.6.11`; Server
common `2.17.1`.
> - **Telemetry**: Browser telemetry `1.0.14` (uses browser SDK
`0.10.0`); Node OTEL `1.3.5`.
> - **Stores**: DynamoDB `6.2.17`; Redis `4.2.17` (peer/dev deps to Node
SDK `9.10.5`).
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
2615b2d. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

4 participants