Skip to content

feat: Support zero and indefinite initialization waiting - #2024

Merged
kinyoklion merged 3 commits into
mainfrom
devin/1789570917-of-start-wait
Oct 9, 2026
Merged

kinyoklion merged 3 commits into
mainfrom
devin/1789570917-of-start-wait

Conversation

@kinyoklion

@kinyoklion kinyoklion commented Sep 16, 2026 •

Copy link
Copy Markdown
Member

Gives the OpenFeature providers the initialization waiting values the OpenFeature provider spec (OFP) requires, which the numeric-only initTimeoutSeconds could not express.

  • initTimeoutSeconds: 'forever' waits indefinitely for the LaunchDarkly client
  • initTimeoutSeconds: 0 waits nowhere and fails initialization unless the client is already ready, so readiness is observed through provider events
  • A positive timeout behaves as before, and the default is still 10 seconds
  • Node provider README feature matrix row updated for the new values
Implementation details

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

Related issues

OFP requirement 4.3.4 requires a value distinct from any duration to request waiting indefinitely, and 4.3.6 requires a zero wait to wait nowhere and fail initialization. Sibling changes for the same requirement: launchdarkly/openfeature-java-server#66, launchdarkly/openfeature-python-server#64, launchdarkly/openfeature-dotnet-server#71, launchdarkly/openfeature-ruby-server#36.

Describe the solution you've provided

BaseProviderConfig.initTimeoutSeconds and the Node provider's constructor parameter are now number | 'forever', and zero is no longer coalesced into the default, since ?? only replaces undefined. waitForInitialization treats a falsy timeout as no timeout, so zero cannot be passed through: initialization races the pending initialization promise against an immediately rejected one, which succeeds only when the client is already ready.

The Cloudflare provider is unaffected because it evaluates from a KV namespace and has no data source to wait for.

Describe alternatives you've considered

number | null was used initially for the indefinite case; 'forever' reads better at the call site and matches the repository's preference for string unions. Adding initialized() to the client contract would let the zero case be checked directly, but that is a breaking change to a published interface for behavior the existing promise already expresses.

Additional context

Verified with yarn workspace @launchdarkly/openfeature-js-server-common test (82 tests), yarn workspace @launchdarkly/openfeature-node-server test (29 tests), and lint, format and build checks for both packages.

Link to Devin session: https://app.devin.ai/sessions/1fd3fcbfe79f482e8b58be29e8df2ffb
Open in Devin Desktop: https://app.devin.ai/desktop/session/1fd3fcbfe79f482e8b58be29e8df2ffb?variant=devin
Requested by: @kinyoklion


Note

Overview
Extends initTimeoutSeconds on the shared BaseOpenFeatureProvider and the Node LaunchDarklyProvider to number | 'forever', aligning initialization with the OpenFeature provider spec.

'forever' calls waitForInitialization() with no timeout. 0 no longer falls through to the 10-second default (only undefined does); initialization races the client’s init promise against an immediate failure so it succeeds only when the client is already ready, otherwise it throws a clear error. Positive timeouts behave as before (default 10 seconds).

The Node provider README initialization row documents the new values, and unit tests cover indefinite wait, zero-timeout failure, and zero-timeout success when already ready.

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

Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration

Copy link
Copy Markdown
Contributor

@cursor review

@github-actions

github-actions Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 29338 bytes
Compressed size limit: 29500
Uncompressed size: 141229 bytes

Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com>
@github-actions

github-actions Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

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

Comment thread packages/sdk/openfeature-node-server/src/LaunchDarklyProvider.ts Outdated
…n waiting

Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com>
@kinyoklion
kinyoklion marked this pull request as ready for review October 8, 2026 22:45
@kinyoklion
kinyoklion requested a review from a team as a code owner October 8, 2026 22:45
@kinyoklion
kinyoklion merged commit 8bfd257 into main Oct 9, 2026
58 checks passed
@kinyoklion
kinyoklion deleted the devin/1789570917-of-start-wait branch October 9, 2026 15:52
@github-actions github-actions Bot mentioned this pull request Oct 9, 2026
joker23 pushed a commit that referenced this pull request Oct 13, 2026
🤖 I have created a release *beep* *boop*
---


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

##
[6.4.0](node-server-sdk-dynamodb-v6.3.3...node-server-sdk-dynamodb-v6.4.0)
(2026-10-13)


### Features

* Update store peer dep floor to 9.14.1 to better support error
reporting and recovery
([#2097](#2097))
([1369fa4](1369fa4))
</details>

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

##
[4.4.0](node-server-sdk-redis-v4.3.3...node-server-sdk-redis-v4.4.0)
(2026-10-13)


### Features

* Update store peer dep floor to 9.14.1 to better support error
reporting and recovery
([#2097](#2097))
([1369fa4](1369fa4))
</details>

<details><summary>openfeature-cloudflare-server: 1.0.8</summary>

##
[1.0.8](openfeature-cloudflare-server-v1.0.7...openfeature-cloudflare-server-v1.0.8)
(2026-10-13)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
* @launchdarkly/openfeature-js-server-common bumped from 2.0.6 to 2.1.0
</details>

<details><summary>openfeature-js-server-common: 2.1.0</summary>

##
[2.1.0](openfeature-js-server-common-v2.0.6...openfeature-js-server-common-v2.1.0)
(2026-10-13)


### Features

* Support zero and indefinite initialization waiting
([#2024](#2024))
([8bfd257](8bfd257))
</details>

<details><summary>openfeature-node-server: 2.1.0</summary>

##
[2.1.0](openfeature-node-server-v2.0.12...openfeature-node-server-v2.1.0)
(2026-10-13)


### Features

* Support zero and indefinite initialization waiting
([#2024](#2024))
([8bfd257](8bfd257))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
* @launchdarkly/openfeature-js-server-common bumped from 2.0.6 to 2.1.0
</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]
> **Overview**
> Release Please version bump for five packages: manifests, changelogs,
`package.json` versions, and example app dependency pins.
> 
> **`@launchdarkly/openfeature-js-server-common` 2.1.0** (and dependent
**`openfeature-node-server` 2.1.0**, **`openfeature-cloudflare-server`
1.0.8**) ship support for **zero** and **`'forever'`** provider
initialization timeouts via `initTimeoutSeconds`, in addition to the
existing numeric default. Node provider updates its reported
`wrapperVersion` to `2.1.0`.
> 
> **`node-server-sdk-dynamodb` 6.4.0** and **`node-server-sdk-redis`
4.4.0** are minor releases documenting a raised **minimum
`@launchdarkly/node-server-sdk` peer dependency (≥9.14.1)** for store
error reporting and recovery alignment.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
4d72062. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/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

devin-pr PRs created by Devin AI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants