Skip to content

Conversation

@joker23
Copy link
Contributor

@joker23 joker23 commented Dec 4, 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

Additional context

  • I did not implement a configuration to set the retry interval (pending comments on whether or not we want to reuse the backoff logic)
  • I set the default retry limit to 3
  • I made it so that if users set retry to less than 0 then we will log a warning and continue with limit set to default (3)

Note

Adds 3-attempt (1s interval) retry to initial polling in BrowserDataManager, with tests for success and max-retry failure.

  • Browser SDK
    • packages/sdk/browser/src/BrowserDataManager.ts:
      • Add _requestPayload helper implementing retry for initial poll (max 3 retries, 1s delay) using shouldRetry, sleep, and httpErrorMessage.
      • Refactor _finishIdentifyFromPoll to use _requestPayload; maintain error reporting via DataSourceStatusManager.
      • Import new utilities from @launchdarkly/js-client-sdk-common.
    • Tests (packages/sdk/browser/__tests__/BrowserDataManager.test.ts):
      • Add tests verifying retries until success and rejection after max retries using fake timers and mocked fetch.

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

This update introduces a new option for initial polling retries in the BrowserDataManager. Changes:

- The `initialPollingRetries` parameter has been added to the `BrowserIdentifyOptions` interface, allowing users to specify the maximum number of retries for the initial polling request, defaulting to 3.
- The `_requestPayload` method has been refactored to implement this retry logic, enhancing the robustness of the polling mechanism.
@joker23 joker23 requested a review from a team as a code owner December 4, 2025 19:04
@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 2025

@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

github-actions bot commented Dec 4, 2025

@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

github-actions bot commented Dec 4, 2025

@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

This commit will:
- introduce new unit tests
- fixed a counting issue with retries
@joker23 joker23 force-pushed the skz/sdk-1566/initial-poll-retry branch from 45f9762 to 9a9e637 Compare December 4, 2025 20:04
@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 2025

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

lastError = e;
// NOTE: current we are hardcoding the retry interval to 1 second.
// We can make this configurable in the future.
// TODO: Reviewer any thoughts on this? Probably the easiest thing is to make this configurable
Copy link
Member

Choose a reason for hiding this comment

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

This is a reasonable start, and then we should look at adding some backoff to it later.

With FDv2 we may consider things a little differently. For example, if streaming is enabled, then this failing just means we may end up initializing from streaming. So we don't want to spend too long on this step.

*
* Defaults to 3.
*/
initialPollingRetries?: number;
Copy link
Member

Choose a reason for hiding this comment

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

This is interesting. I had not considered having this at the identify options level, versus being a client-level option. I am tempted to say we just don't expose the lever at all right now. If we do, then we probably do need that back-off logic. Because we don't want to, for example, retry 50 times once per second.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea, looking back at this, I agree with not exposing this for now. The original thought was that the identify() method is what really triggers the initialization here so it (kind of) made sense for initialization options to live in identifyOptions. I created another work item to align the initialization with what we have in flutter sdk so this implementation now makes less sense, I'll remove this option for now.

@joker23 joker23 merged commit cd91013 into main Dec 9, 2025
36 of 37 checks passed
@joker23 joker23 deleted the skz/sdk-1566/initial-poll-retry branch December 9, 2025 19:12
@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.

3 participants