Repository navigation
feat!: Require status and stop methods on feature stores - #478
Merged
Merged
Conversation
The SDK no longer checks with respond_to? for the optional feature store methods. Custom stores must now implement them. A custom LaunchDarkly::Interfaces::FeatureStore must implement: - monitoring_enabled? -- return true only if the store publishes status updates when it becomes unavailable and when it recovers. In-memory stores return false. - available? -- return true if the underlying data store is reachable. The SDK polls this method after a store operation fails, while monitoring is enabled. Stores that cannot become unavailable return true. - stop -- release resources. The SDK calls it when the client closes. A custom FeatureStoreCore used with CachingStoreWrapper must implement available? and stop. CachingStoreWrapper now always reports monitoring_enabled? as true and delegates available? to the core. Before this change, a store without these methods silently lost status monitoring, and a core without available? turned monitoring off. The interface docs also disagreed on whether available? would stay. Making the methods required gives one clear contract and removes the probing. The lifecycle method stays named stop. All built-in stores, the big segment store, data sources and event processors already use stop, so renaming only the feature store to close would make the SDK less consistent.
keelerm84
marked this pull request as ready for review
November 2, 2026 17:37
kinyoklion
approved these changes
Nov 3, 2026
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.
The SDK no longer checks with respond_to? for the optional feature store
methods. Custom stores must now implement them.
A custom LaunchDarkly::Interfaces::FeatureStore must implement:
updates when it becomes unavailable and when it recovers. In-memory
stores return false.
The SDK polls this method after a store operation fails, while
monitoring is enabled. Stores that cannot become unavailable return
true.
A custom FeatureStoreCore used with CachingStoreWrapper must implement
available? and stop. CachingStoreWrapper now always reports
monitoring_enabled? as true and delegates available? to the core.
Before this change, a store without these methods silently lost status
monitoring, and a core without available? turned monitoring off. The
interface docs also disagreed on whether available? would stay. Making
the methods required gives one clear contract and removes the probing.
The lifecycle method stays named stop. All built-in stores, the big
segment store, data sources and event processors already use stop, so
renaming only the feature store to close would make the SDK less
consistent.
Note
Overview
Breaking change:
LaunchDarkly::Interfaces::FeatureStorenow requiresmonitoring_enabled?,available?, andstopwith updated interface docs (no more optional/respond_to?probing).The SDK stops inferring monitoring support from whether
available?exists. Client wrappers (FeatureStoreClientWrapper,FeatureStoreClientWrapperV2) read@store.monitoring_enabled?directly, exposeavailable?as a delegate, and drop the oldstore_supports_monitoring?/does_store_support_monitoring?helpers.StatusProviderV2likewise trustsmonitoring_enabled?on the store when present.Built-in and integration paths are aligned:
InMemoryFeatureStoreaddsavailable?→ true;CachingStoreWrapperalways reports monitoring enabled and forwardsavailable?/stoptoFeatureStoreCore(which now documents those methods). FDv2Store#closealways callspersistent_store.stopwithout arespond_to?(:stop)guard.Specs and test doubles implement the new methods; a legacy test that assumed monitoring was off when
available?was missing was removed.Reviewed by Cursor Bugbot for commit 1b65ab6. Bugbot is set up for automated code reviews on this repo. Configure here.