Skip to content

Conversation

@keelerm84
Copy link
Member

@keelerm84 keelerm84 commented Nov 19, 2025

  • temp debugging
  • chore: Reorganize import structure to align with compatibility expectations

Note

Consolidates FDv2 types into ldclient.interfaces, introduces datasystem builder APIs (with optional FDv1 fallback), updates polling/streaming and file/test data sources, and refreshes FDv2 system/persistence and tests.

  • Core API/Interfaces:
    • Move FDv2 protocol and lifecycle types (Selector, ChangeSet, Basis, Update, Initializer, Synchronizer, EventName, ObjectKind, etc.) into ldclient.interfaces; update imports across modules.
    • Trim ldclient.impl.datasystem.protocolv2 to data payload types (PutObject, DeleteObject, Goodbye, Error).
  • Data System Builders (ldclient/datasystem.py):
    • Add ConfigBuilder with initializers, synchronizers, fdv1_compatible_synchronizer, and data_store.
    • Provide default, streaming, polling, and custom presets; expose polling_ds_builder, streaming_ds_builder, and fdv1_fallback_ds_builder.
  • Data Sources:
    • Update polling/streaming to implement Initializer/Synchronizer; support env ID propagation and FDv1 fallback via headers (_LD_ENVID_HEADER, _LD_FD_FALLBACK_HEADER).
    • Remove impl/datasourcev2/status.py; inline status handling where used.
  • FDv2 System:
    • Refactor FDv2 to include inlined data source/store status providers, persistent store wrapper, outage recovery, and synchronizer fallback/recovery logic (including FDv1 fallback path).
    • Make FDv1/FDv2 implement DataSystem.
  • Integrations:
    • Add Files.new_data_source_v2 builder and implement file-based FDv2 initializer/synchronizer.
    • Add TestDataV2-based FDv2 initializer/synchronizer implementations.
  • Contract tests:
    • Update contract-tests/client_entity.py to use ldclient.datasystem builders and configure optional FDv1 fallback.
  • Config:
    • Import Initializer/Synchronizer from ldclient.interfaces; keep DataSystemConfig as the shared config carrier.
  • Tests:
    • Update and expand tests for polling/streaming parsers, FDv2 datasystem behavior (fallbacks, persistence, env ID), file/test data sources; remove obsolete status tests.

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

In the previous setup, we would only check the fallback or recovery
conditions once the synchronizer returned an update. If the synchronizer
was stuck, or nothing was changing in the environment, we would never
check the conditions.

This configuration also exposed an interesting behavior. If the
synchronizer cannot connect, it will emit error updates. Each time we
receive an error, we check if we have failed to initialize for the last
10 seconds. If so, we re-create the primary synchronizer.

When it continues to fail, the first update will trigger the condition
check. And since it has still failed for 10 seconds, it will immediately
error out. With this change, we can be assured a synchronizer is given
at least 10 seconds to try before the condition is evaluated.
@keelerm84 keelerm84 requested a review from a team as a code owner November 19, 2025 21:13
@keelerm84 keelerm84 changed the title mk/sdk xxx/reorg chore: Reorganize import structure to align with compatibility expectations Nov 19, 2025
Base automatically changed from mk/sdk-1579/improve-recovery to feat/fdv2 November 19, 2025 21:35
@keelerm84 keelerm84 merged commit e9e8304 into feat/fdv2 Nov 19, 2025
15 checks passed
@keelerm84 keelerm84 deleted the mk/sdk-xxx/reorg branch November 19, 2025 22:00
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