Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: launchdarkly/openfeature-java-server
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.2.1
Choose a base ref
...
head repository: launchdarkly/openfeature-java-server
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2.0.0
Choose a head ref
  • 4 commits
  • 6 files changed
  • 4 contributors

Commits on Sep 29, 2026

  1. docs: Describe long evaluation and domain scoping in the feature matr…

    …ix (#67)
    
    Brings the feature matrix up to date with capabilities the OpenFeature
    Java SDK added since the matrix was written (`getLongEvaluation` and
    domain-bound provider initialization in 1.22.0).
    
    - Providers row now states that long evaluation comes from the SDK
    default, which evaluates the flag as a double and rejects out-of-range
    or fractional values
    - Domains row now states the provider is not domain-scoped, so one
    instance can serve several domains
    
    **Requirements**
    
    - [x] I have added test coverage for new or changed functionality
    (documentation only)
    - [x] I have followed the repository's [pull request submission
    guidelines](../blob/main/CONTRIBUTING.md#submitting-pull-requests)
    - [x] I have validated my changes against all supported platform
    versions
    
    **Related issues**
    
    None.
    
    <details>
    <summary>Implementation details</summary>
    
    Verified against the OpenFeature Java SDK 1.22.1 `FeatureProvider`
    interface: `getLongEvaluation` has a default implementation delegating
    to `getDoubleEvaluation` with safe-range checks, and
    `initialize(EvaluationContext, String domain)` plus `isDomainScoped()`
    are defaults the provider correctly leaves alone — the LaunchDarkly
    client holds no per-domain state.
    
    No behavior change was needed: overriding `getLongEvaluation` would not
    improve precision, because LaunchDarkly numeric flag values are JSON
    numbers surfaced as doubles.
    
    Documentation only; no code or tests changed.
    
    </details>
    
    
    Link to Devin session:
    https://app.devin.ai/sessions/a47abf28ecd44130917b9b5131287221
    Open in Devin Desktop:
    https://app.devin.ai/desktop/session/a47abf28ecd44130917b9b5131287221?variant=devin
    Requested by: @kinyoklion
    
    <!-- CURSOR_SUMMARY -->
    ---
    
    > [!NOTE]
    > **Overview**
    > Updates the README **feature matrix** to document OpenFeature Java SDK
    1.22.x behavior—no runtime or test changes.
    > 
    > The **Providers** row now explains that **long** flag evaluation
    relies on the SDK default (`getDoubleEvaluation` with range/fraction
    checks), not a custom provider override. The **Domains** row clarifies
    that the provider is **not** `isDomainScoped` and a single instance can
    be registered for multiple domains because it holds no per-domain state.
    > 
    > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
    b9c9413. 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: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
    kinyoklion and devin-ai-integration[bot] authored Sep 29, 2026
    Configuration menu
    Copy the full SHA
    2363198 View commit details
    Browse the repository at this point in the history

Commits on Oct 28, 2026

  1. fix: Include an error code in provider error events (#68)

    **Requirements**
    
    - [x] I have added test coverage for new or changed functionality
    - [x] I have followed the repository's [pull request submission
    guidelines](../blob/main/CONTRIBUTING.md#submitting-pull-requests)
    - [ ] I have validated my changes against all supported platform
    versions
    
    **Related issues**
    
    OFP requirement 5.1.5 (sdk-specs `OFP-openfeature-provider-behavior`):
    `PROVIDER_ERROR` events SHOULD populate the event details' error code.
    
    **Describe the solution you've provided**
    
    When the LaunchDarkly data source transitions to `OFF`, the emitted
    `PROVIDER_ERROR` event details now include `ErrorCode.GENERAL` alongside
    the existing message:
    
    ```java
    emitProviderError(ProviderEventDetails.builder().message(message).errorCode(ErrorCode.GENERAL).build());
    ```
    
    Added `LifeCycleTest.itIncludesAnErrorCodeInErrorEvents`.
    
    **Describe alternatives you've considered**
    
    A more specific code (e.g. `PROVIDER_FATAL` for 401/403) was not used;
    OFP does not define a mapping, and the Python provider already uses
    `GENERAL` for the same transition. Choosing per-error codes would be a
    cross-SDK decision.
    
    **Additional context**
    
    OpenFeature Java SDK 1.23.0 fixed propagation of `errorCode` from
    provider event details to handler `EventDetails`, so handlers now
    observe this value.
    
    Link to Devin session:
    https://app.devin.ai/sessions/929f5530882d40bc95e55391e97536d5
    Open in Devin Desktop:
    https://app.devin.ai/desktop/session/929f5530882d40bc95e55391e97536d5?variant=devin
    Requested by: @kinyoklion
    
    [SDK-3254](https://launchdarkly.atlassian.net/browse/SDK-3254)
    
    
    [SDK-3254]:
    https://launchdarkly.atlassian.net/browse/SDK-3254?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
    
    <!-- CURSOR_SUMMARY -->
    ---
    
    > [!NOTE]
    > **Overview**
    > Aligns **PROVIDER_ERROR** event details with OpenFeature provider
    behavior (OFP 5.1.5) by setting **`ErrorCode.GENERAL`** when the
    LaunchDarkly data source enters **`OFF`** and the provider moves to
    error state. Error messages are unchanged; handlers can now read
    **`detail.getErrorCode()`** (supported after OpenFeature Java SDK
    1.23.0).
    > 
    > Adds **`LifeCycleTest.itIncludesAnErrorCodeInErrorEvents`** to assert
    the error code on **`PROVIDER_ERROR`** using the existing delayed
    failing data source setup.
    > 
    > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
    dd3f67a. 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: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
    kinyoklion and devin-ai-integration[bot] authored Oct 28, 2026
    Configuration menu
    Copy the full SHA
    bcf5a39 View commit details
    Browse the repository at this point in the history

Commits on Nov 4, 2026

  1. feat!: Add a start wait time option for initialization (#66)

    **Requirements**
    
    - [x] I have added test coverage for new or changed functionality
    - [x] I have followed the repository's [pull request submission
    guidelines](../blob/main/CONTRIBUTING.md#submitting-pull-requests)
    - [x] I have validated my changes against all supported platform
    versions
    
    **Related issues**
    
    Fixes #58.
    
    **Describe the solution you've provided**
    
    Adds `Provider(String sdkKey, LDConfig config, Duration startWait)` so
    an application can bound, or deliberately opt out of, waiting for
    initialization, matching the OpenFeature provider spec (OFP)
    requirements for start wait behavior:
    
    - a positive `Duration` is applied by the LaunchDarkly client
    constructor, and `initialize` then reports whether the client became
    ready without waiting a second time
    - `Duration.ZERO` waits nowhere; `initialize` fails unless the client is
    already ready, and the application learns when it becomes usable from
    provider events
    - `Provider.INFINITE_START_WAIT` requests indefinite waiting: nothing is
    waited for during construction and `initialize` blocks until the data
    source becomes valid or fails permanently
    
    The existing constructors keep honouring
    `LDConfig.Builder.startWait(...)` and no longer wait again in
    `initialize`, so a configured start wait is the only bound on
    initialization instead of being followed by an unbounded wait. The
    README feature matrix row and initialization section describe the new
    behavior.
    
    <details>
    <summary>Implementation details</summary>
    
    `initialize` still registers data source and flag change listeners and
    evaluates the current data source status. Only the indefinite mode
    leaves the completion future pending; every other mode completes it with
    the outcome that is already known, so `initialize` returns promptly.
    
    The OpenFeature SDK emits its own event for the transition that
    completes initialization, so the provider records that one state without
    emitting a duplicate, and emits every state change after it — including
    a permanent failure that arrives immediately after the data source
    became valid, and a recovery after a failed initialization.
    
    </details>
    
    **Describe alternatives you've considered**
    
    Keeping the existing indefinite wait and adding a timeout parameter
    interpreted only inside `initialize` would double-wait when
    `LDConfig.startWait` is also set, and would not match OFP, which treats
    the start wait as a bound over construction plus initialization.
    
    Java has no built-in infinite `Duration`, so indefinite waiting was
    initially expressed as `null`. It is now the explicit
    `Provider.INFINITE_START_WAIT` constant, matching
    `Timeout.InfiniteTimeSpan` in the .NET provider.
    
    **Additional context**
    
    Sibling changes for the same OFP requirement:
    launchdarkly/openfeature-python-server#64,
    launchdarkly/openfeature-ruby-server#36,
    launchdarkly/openfeature-dotnet-server#71, and
    launchdarkly/js-core#2024.
    
    Verified with `./gradlew test` (all tests pass, including new coverage
    for positive, zero, and indefinite start wait).
    
    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
    
    [SDK-3285](https://launchdarkly.atlassian.net/browse/SDK-3285)
    
    <!-- CURSOR_SUMMARY -->
    ---
    
    > [!NOTE]
    > **Overview**
    > Fixes OpenFeature initialization behavior (**#58**) by adding
    **`Provider(String, LDConfig, Duration startWait)`** and
    **`Provider.INFINITE_START_WAIT`**, so startup waiting is bounded in one
    place instead of blocking again indefinitely inside **`initialize()`**
    after **`LDConfig.startWait`**.
    > 
    > **Positive durations** apply during client construction;
    **`Duration.ZERO`** fails fast unless already ready; **indefinite** mode
    skips construction blocking and waits in **`initialize()`** until the
    data source is valid, fails, or the provider shuts down. Oversized
    durations are treated as indefinite to avoid SDK millis overflow.
    > 
    > **`initialize()`** is reworked around a completion future and tighter
    state/event handling: failed init surfaces data-source errors, duplicate
    **STALE**/**READY** events are deduped, teardown **OFF** does not emit
    **PROVIDER_ERROR**, and **`shutdown()`** calls **`super.shutdown()`** to
    stop leaking the event executor. README documents cancellation of
    indefinite **`setProviderAndWait`** (direct **`provider.shutdown()`** vs
    API lock contention).
    > 
    > Lifecycle tests cover bounded/zero/infinite waits, recovery, and
    classification boundaries.
    > 
    > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
    1c96e64. Bugbot is set up for automated
    code reviews on this repo. Configure
    [here](https://www.cursor.com/dashboard/bugbot).</sup>
    <!-- /CURSOR_SUMMARY -->
    
    ---
    
    ## tanderson-ld additional changes
    
    Review-driven hardening of the start wait time behavior, on top of the
    commits above. Summary of the delta:
    
    **Indefinite wait is now cancellable.** `shutdown()` completes the
    initialization future, and the interrupt flag is restored if the waiting
    thread is interrupted. The README and constructor javadoc document how
    to cancel an indefinite `setProviderAndWait`: call `provider.shutdown()`
    directly from another thread, or register with the non-blocking
    `setProvider`. `OpenFeatureAPI.shutdown()` **cannot** end such a wait —
    it blocks on the same API lock `setProviderAndWait` holds for the
    duration of initialization. This lock-contention deadlock is inherent to
    the OpenFeature Java SDK (it holds the API write lock across a
    synchronous `initialize()` and contends on it in `shutdown()`), so it is
    documented rather than worked around; an upstream issue will be filed
    against the OpenFeature Java SDK.
    
    **Start wait time classification / validation.**
    - Any start wait time too large to represent in milliseconds — including
    `Provider.INFINITE_START_WAIT` and any other "forever" duration — is
    classified as indefinite, so it saturates to the indefinite path instead
    of overflowing when the SDK converts it to milliseconds. (Separately, a
    too-large duration configured through `LDConfig.Builder.startWait`
    instead of the constructor still overflows inside the SDK client
    constructor and leaks the client; that is pre-existing SDK behavior and
    has been filed as a separate java-core ticket. The sentinel is
    documented as constructor-argument-only.)
    - A `null` start wait time falls through to the SDK's default start wait
    rather than throwing.
    
    **Status / event fidelity.**
    - A failed initialization carries the data source's last error into the
    thrown exception, so the OpenFeature error event reports the cause
    rather than a generic message.
    - The client's `isInitialized()` latch no longer reports `READY` when
    the data source is currently `OFF`.
    - Repeated interruptions emit one `PROVIDER_STALE` per state change
    (state-based dedupe, retained and documented), and stale events now
    carry the HTTP error detail.
    
    **Lifecycle cleanup.** `shutdown()` removes its flag-change and
    data-source status listeners and calls `super.shutdown()` to terminate
    the event emitter executor.
    
    **Tests.** Added lifecycle coverage for bounded / zero / indefinite
    waits, failed-init-then-recovery, interruption → stale → ready,
    single-stale-per-outage dedupe, cancellation of an indefinite
    `setProviderAndWait` via a direct `provider.shutdown()`, the
    `OFF`-while-initialized exclusion, listener removal on shutdown, and a
    direct unit test of the start-wait classification boundary. Full suite
    and checkstyle pass.
    
    
    [SDK-3285]:
    https://launchdarkly.atlassian.net/browse/SDK-3285?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
    
    ---------
    
    Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
    Co-authored-by: Todd Anderson <[email protected]>
    3 people authored Nov 4, 2026
    Configuration menu
    Copy the full SHA
    240f19c View commit details
    Browse the repository at this point in the history

Commits on Nov 5, 2026

  1. chore(main): release 2.0.0 (#69)

    🤖 I have created a release *beep* *boop*
    ---
    
    
    ##
    [2.0.0](1.2.1...2.0.0)
    (2026-11-04)
    
    
    ### ⚠ BREAKING CHANGES
    
    * Add a start wait time option for initialization
    ([#66](#66))
    
    ### Features
    
    * Add a start wait time option for initialization
    ([#66](#66))
    ([240f19c](240f19c))
    
    ---
    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**
    > This Release Please PR **bumps the library from `1.2.1` to `2.0.0`**
    in `gradle.properties` and `.release-please-manifest.json`, and **adds
    the `2.0.0` section to `CHANGELOG.md`**.
    > 
    > The release notes document a **breaking change**: a configurable
    **start wait time** for provider initialization (issue #66), so
    `initialize` behavior and constructor options may differ from 1.x. No
    application source changes appear in this diff—only version and
    changelog updates for the tagged release.
    > 
    > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
    d994e75. 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>
    github-actions[bot] authored Nov 5, 2026
    Configuration menu
    Copy the full SHA
    559ba3f View commit details
    Browse the repository at this point in the history
Loading