Skip to content

Conversation

@jsonbailey
Copy link
Contributor

@jsonbailey jsonbailey commented Jan 29, 2026

Tracked internally: SDK-1789


Note

Medium Risk
Touches core networking and FDv2 data acquisition construction paths (polling/streaming/event delivery) and changes builder interfaces; misconfiguration could cause incorrect endpoints/timeouts or break custom integrations relying on the old proc/initializer methods.

Overview
Refactors the FDv2 data system to use builder objects (with #build(sdk_key, config)) instead of procs for initializers/synchronizers, updating DataSystem factories, DataSystemConfig docs, and the FDv2 runtime to call .build.

Introduces HttpConfigOptions plus a DataSourceBuilderCommon mixin so polling/streaming builders can independently configure base_uri, socket_factory, and HTTP timeouts; polling and streaming requesters/data sources are updated to use these per-builder HTTP settings rather than pulling everything from global Config.

Updates event sending and legacy polling request code to use the new HTTP config object and removes the injectable HTTP client from EventSender. Contract tests and specs are adjusted to construct and pass the new builders (including a new TestDataV2 builder and test MockBuilder) and to configure FDv1 fallback builder settings from the first available polling config.

Written by Cursor Bugbot for commit c33b4d8. This will update automatically on new commits. Configure here.

@inbox_full = Concurrent::AtomicBoolean.new(false)

event_sender = (test_properties || {})[:event_sender] ||
Impl::EventSender.new(sdk_key, config, client || Impl::Util.new_http_client(config.events_uri, config))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing this line has made the client parameter unused. Were we ever providing this and are we appropriately capturing that level of control that we previously had?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The client was actually unused in the EventSender initializer and it just constructed its own client.

@jsonbailey jsonbailey marked this pull request as ready for review January 29, 2026 17:01
@jsonbailey jsonbailey requested a review from a team as a code owner January 29, 2026 17:01
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

def build(sdk_key, config)
http_opts = build_http_config
requester = @requester || HTTPPollingRequester.new(sdk_key, http_opts, config)
PollingDataSource.new(@poll_interval || DEFAULT_POLL_INTERVAL, requester, config.logger)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Builder defaults bypass user Config settings

Medium Severity

The data source builders now fall back to hardcoded DEFAULT_* constants instead of Config values when builder settings aren't explicitly set. Previously, PollingDataSourceBuilder.build used @config.poll_interval, but now uses @poll_interval || DEFAULT_POLL_INTERVAL. Similarly, StreamingDataSourceBuilder ignores config.initial_reconnect_delay and config.stream_uri, and build_http_config ignores config.base_uri, config.read_timeout, config.connect_timeout, and config.socket_factory. Users setting these values in Config while using DataSystem.default() or similar factory methods will have their settings silently ignored.

Additional Locations (2)

Fix in Cursor Fix in Web

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The behavior is intentional by design—when data_system_config is not set, FDv1 is used and reads from Config; when using the new DataSystem API, configuration is done via the builder methods (like .poll_interval(), .base_uri()), not Config, as these are two separate and mutually exclusive configuration systems with synchronized defaults.

@jsonbailey jsonbailey merged commit e60474c into main Jan 29, 2026
11 checks passed
@jsonbailey jsonbailey deleted the jb/support-builder-level-config-fdv2 branch January 29, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants