Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
5003b43
chore: Add FDv2 compatible data source for testing
jsonbailey Jan 7, 2026
065f066
Update lib/ldclient-rb/integrations/test_data_v2/flag_builder_v2.rb
jsonbailey Jan 12, 2026
e99c7fc
adding tests and including fixes identified during tests
jsonbailey Jan 12, 2026
8a8b294
fix tests
jsonbailey Jan 12, 2026
13cd0a4
fix deep copy issue
jsonbailey Jan 13, 2026
2fc9fa0
fix lint error
jsonbailey Jan 13, 2026
1077e2d
because of thread.join with timeouts increase waits to avoid flaky tests
jsonbailey Jan 13, 2026
7066680
chore: Create FDv2 and fallback polling data source
jsonbailey Jan 13, 2026
4f75f75
address feedback
jsonbailey Jan 13, 2026
4b79d47
Merge branch 'main' into jb/sdk-1544/fdv2-polling-data-source
jsonbailey Jan 13, 2026
4bf0b8f
one more name change
jsonbailey Jan 13, 2026
b97a23d
prevent immediate retry
jsonbailey Jan 13, 2026
fa0bb87
always set selector in changeset builder
jsonbailey Jan 13, 2026
6547940
chore: Create FDv2 streaming data source
jsonbailey Jan 13, 2026
2d00acf
fix lint issues
jsonbailey Jan 14, 2026
e4fdafe
enable updating basis on reconnect
jsonbailey Jan 15, 2026
6e0a89b
Merge branch 'main' into jb/sdk-1545/fdv2-streaming-data-source
jsonbailey Jan 20, 2026
e7458e2
fix lint error
jsonbailey Jan 20, 2026
a0725ef
Merge branch 'main' into jb/sdk-1545/fdv2-streaming-data-source
jsonbailey Jan 20, 2026
dc700f0
stop streamer if we are falling back
jsonbailey Jan 20, 2026
b3ffac4
enable fdv2 configs
jsonbailey Jan 21, 2026
021b0b2
fix streaming sync to block while running
jsonbailey Jan 21, 2026
3761f39
address feedback
jsonbailey Jan 21, 2026
7c73f81
address feedback
jsonbailey Jan 21, 2026
4e34923
Apply suggestions from code review
jsonbailey Jan 22, 2026
b77b606
address feedback
jsonbailey Jan 22, 2026
ab01cd4
Use symbols for event types
jsonbailey Jan 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion launchdarkly-server-sdk.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Gem::Specification.new do |spec|

spec.add_runtime_dependency "benchmark", "~> 0.1", ">= 0.1.1"
spec.add_runtime_dependency "concurrent-ruby", "~> 1.1"
spec.add_runtime_dependency "ld-eventsource", "2.2.6"
spec.add_runtime_dependency "ld-eventsource", "2.4.0"
spec.add_runtime_dependency "observer", "~> 0.1.2"
spec.add_runtime_dependency "openssl", ">= 3.1.2", "< 5.0"
spec.add_runtime_dependency "semantic", "~> 1.6"
Expand Down
1 change: 1 addition & 0 deletions lib/ldclient-rb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module LaunchDarkly
# Public APIs - these define the main interfaces users interact with
require "ldclient-rb/config"
require "ldclient-rb/context"
require "ldclient-rb/data_system"
require "ldclient-rb/flags_state"
require "ldclient-rb/integrations"
require "ldclient-rb/interfaces"
Expand Down
6 changes: 3 additions & 3 deletions lib/ldclient-rb/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Config
# @option opts [Hash] :application See {#application}
# @option opts [String] :payload_filter_key See {#payload_filter_key}
# @option opts [Boolean] :omit_anonymous_contexts See {#omit_anonymous_contexts}
# @option opts [DataSystemConfig] :datasystem_config See {#datasystem_config}
# @option opts [DataSystemConfig] :data_system_config See {#data_system_config}
# @option hooks [Array<Interfaces::Hooks::Hook]
# @option plugins [Array<Interfaces::Plugins::Plugin]
#
Expand Down Expand Up @@ -84,7 +84,7 @@ def initialize(opts = {})
@hooks = (opts[:hooks] || []).keep_if { |hook| hook.is_a? Interfaces::Hooks::Hook }
@plugins = (opts[:plugins] || []).keep_if { |plugin| plugin.is_a? Interfaces::Plugins::Plugin }
@omit_anonymous_contexts = opts.has_key?(:omit_anonymous_contexts) && opts[:omit_anonymous_contexts]
@datasystem_config = opts[:datasystem_config]
@data_system_config = opts[:data_system_config]
@data_source_update_sink = nil
@instance_id = nil
end
Expand Down Expand Up @@ -440,7 +440,7 @@ def diagnostic_opt_out?
#
# @return [DataSystemConfig, nil]
#
attr_reader :datasystem_config
attr_reader :data_system_config


#
Expand Down
6 changes: 3 additions & 3 deletions lib/ldclient-rb/data_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
require 'ldclient-rb/interfaces/data_system'
require 'ldclient-rb/config'
require 'ldclient-rb/impl/data_system/polling'
require 'ldclient-rb/impl/data_system/streaming'

module LaunchDarkly
#
Expand Down Expand Up @@ -132,9 +133,8 @@ def self.fdv1_fallback_ds_builder
# @return [Proc] A proc that takes (sdk_key, config) and returns a streaming data source
#
def self.streaming_ds_builder
# TODO(fdv2): Implement streaming data source builder
lambda do |_sdk_key, _config|
raise NotImplementedError, "Streaming data source not yet implemented for FDv2"
lambda do |sdk_key, config|
LaunchDarkly::Impl::DataSystem::StreamingDataSourceBuilder.new(sdk_key, config).build
end
end

Expand Down
4 changes: 1 addition & 3 deletions lib/ldclient-rb/impl/data_system/polling.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ def fetch(ss)
#
def sync(ss)
@logger.info { "[LDClient] Starting PollingDataSourceV2 synchronizer" }
@stop.reset
@interrupt_event.reset

until @stop.set?
result = @requester.fetch(ss.selector)
Expand Down Expand Up @@ -440,7 +438,7 @@ def self.polling_payload_to_changeset(data)

next unless event[:event]

case event[:event]
case event[:event].to_sym
when LaunchDarkly::Interfaces::DataSystem::EventName::SERVER_INTENT
begin
server_intent = LaunchDarkly::Interfaces::DataSystem::ServerIntent.from_h(event[:data])
Expand Down
4 changes: 2 additions & 2 deletions lib/ldclient-rb/impl/data_system/protocolv2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def initialize(version:, kind:, key:)
#
# Returns the event name.
#
# @return [String]
# @return [Symbol]
#
def name
LaunchDarkly::Interfaces::DataSystem::EventName::DELETE_OBJECT
Expand Down Expand Up @@ -111,7 +111,7 @@ def initialize(version:, kind:, key:, object:)
#
# Returns the event name.
#
# @return [String]
# @return [Symbol]
#
def name
LaunchDarkly::Interfaces::DataSystem::EventName::PUT_OBJECT
Expand Down
Loading