Skip to content

Conversation

@keelerm84
Copy link
Member

@keelerm84 keelerm84 commented Oct 21, 2025

There is still a lot of work to be done to get this functional, but this gives us some shape to the remaining tasks.


Note

Introduce experimental FDv2 data system (store, polling/streaming, status) with new DataSystemConfig and integrate selection into client; update protocols/APIs and tests.

  • Client/Core:
    • Integrates new FDv2 data system; selects FDv1 when config.datasystem_config is absent, otherwise FDv2 (honors offline).
    • Initialization readiness now based on data_availability.at_least(DataAvailability.CACHED).
    • Wires data system providers (data_store_status_provider, data_source_status_provider, flag_tracker, store) and passes diagnostic accumulator.
  • Datasystem v2:
    • Adds ldclient.impl.datasystem.fdv2.FDv2 with initializer/synchronizer orchestration, fallback/recovery logic, availability, and threading.
    • New Store for FDv2 handling apply/commit, selector, dependency tracking, and flag change notifications.
    • New datasourcev2.status.DataSourceStatusProviderImpl.
    • datasourcev2.polling and datasourcev2.streaming: expose name property; implement sync/fetch behaviors and error handling.
    • Protocol updates: Initializer and Synchronizer now require name property; add to StreamingDataSource and test data source.
  • Configuration:
    • Public DataSystemConfig dataclass added to ldclient.config plus datasystem_config field on Config.
    • impl/datasystem/config.py builder now produces DataSystemConfig; supports default/streaming/polling/custom setups.
  • FDv1:
    • data_availability computed dynamically based on processor/store state.
  • Tests:
    • Add tests for FDv2 orchestration and availability; update polling initializer/synchronizer tests (use name property, expanded error cases);
    • Add config builder tests including immutability and None/empty initializer cases.

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

@keelerm84 keelerm84 requested a review from a team as a code owner October 21, 2025 13:56
Builder = Callable[[], T]


@dataclass(frozen=True)
Copy link
Member Author

Choose a reason for hiding this comment

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

This was moved.

assert valid.change_set.intent_code == IntentCode.TRANSFER_FULL


# def test_swallows_goodbye(events): # pylint: disable=redefined-outer-name
Copy link
Member Author

Choose a reason for hiding this comment

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

These tests don't really make sense in a polling context as they aren't sent then.

self._data_system = FDv1(self._config)
# Provide flag evaluation function for value-change tracking
self._data_system.set_flag_value_eval_fn(
self._data_system.set_flag_value_eval_fn( # type: ignore
Copy link
Member Author

Choose a reason for hiding this comment

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

These ignores are because the data system protocol doesn't expose these methods, but both fdv1 and fdv2 implementations do. So we have to tell the linter to trust us in a few places.

@keelerm84 keelerm84 changed the base branch from main to feat/fdv2 October 30, 2025 15:55
# Wait for all threads to complete
for thread in self._threads:
if thread.is_alive():
thread.join(timeout=5.0) # 5 second timeout
Copy link
Member

Choose a reason for hiding this comment

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

Envious of join with timeout. Do we need to log anything in the timeout case? (Though the is_alive thing really feels questionable, so maybe not.)

@keelerm84 keelerm84 merged commit 4b6a168 into feat/fdv2 Oct 30, 2025
12 of 15 checks passed
@keelerm84 keelerm84 deleted the mk/sdk-1419/fdv2-datasystem-impl branch October 30, 2025 19:40
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