feat: Deprecate the provider getState method - #55
Open
kinyoklion wants to merge 1 commit into
Open
Conversation
Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FeatureProvider#getState()is deprecated in the OpenFeature Java SDK, but this provider overrode it without marking it deprecated, so consumers got no signal to migrate.getState()override@Deprecatedand documentsClient#getProviderState()as the replacementREADYdefault@cursor review
Implementation details
Context
The OpenFeature SDK now tracks provider state itself, from
initializeand from the events this provider emits (ready/stale/error/configuration changed), which is whyFeatureProvider#getState()carries@Deprecatedwith "The state is handled by the SDK internally. Query the state from the Client instead."Alternatives considered
Deleting the override entirely: rejected for now because
FeatureProvidersupplies a default that always returnsREADY, so any consumer still callingprovider.getState()would silently get a wrong answer. Deprecating first gives a migration path; the override can be dropped in a future major.Testing
./gradlew test javadoc— all 44 tests pass and javadoc builds with no new warnings.No visual preview applies — this is a server-side provider change.
Link to Devin session: https://app.devin.ai/sessions/0c452d209ec54b068ba120b4c92b8f6c
Requested by: @kinyoklion
Note
Overview
Aligns this LaunchDarkly OpenFeature server provider with the OpenFeature Java SDK by marking the
getState()override@Deprecatedand documentingClient#getProviderState()as the replacement.The override remains so callers still receive accurate provider state instead of the SDK default
READY; behavior is unchanged aside from deprecation signaling and cleaner compilation (no missing-deprecation warning on this override).Reviewed by Cursor Bugbot for commit 302cd66. Bugbot is set up for automated code reviews on this repo. Configure here.