Skip to content

Conversation

@keelerm84
Copy link
Member

@keelerm84 keelerm84 commented Dec 3, 2025

Note

Adjust availability calculations in FDv1/FDv2 and add tests for offline, LDD, data-source, and store-initialization states.

  • Core datasystem logic:
    • FDv1 (ldclient/impl/datasystem/fdv1.py):
      • Update data_availability to return CACHED in LDD mode only when the store is initialized; otherwise DEFAULTS.
      • Update target_availability to return CACHED in LDD mode; DEFAULTS when offline; otherwise REFRESHED.
    • FDv2 (ldclient/impl/datasystem/fdv2.py):
      • Use config.offline directly in start() to disable the system.
      • Refine data_availability: REFRESHED when selector is defined; CACHED when store initialized; else DEFAULTS.
      • Refine target_availability: DEFAULTS when offline or no data sources and no store; REFRESHED when configured with data sources; otherwise CACHED.
  • Tests:
    • Add test_fdv1_availability.py covering offline, LDD (initialized/uninitialized), and normal mode scenarios.
    • Expand test_fdv2_datasystem.py with availability cases for offline, with/without data sources, and read-only/read-write store (initialized/uninitialized).

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

@keelerm84 keelerm84 requested a review from a team as a code owner December 3, 2025 18:38
@keelerm84 keelerm84 force-pushed the mk/sdk-1654/fix-availability branch from 4804ac1 to efcf0cb Compare December 3, 2025 18:41
@keelerm84 keelerm84 force-pushed the mk/sdk-1654/fix-availability branch from efcf0cb to 1c998cd Compare December 3, 2025 20:04
return DataAvailability.REFRESHED

if not self._configured_with_data_sources or self._store.is_initialized():
if self._store.is_initialized():
Copy link

Choose a reason for hiding this comment

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

Bug: Missing offline check in FDv2 data_availability property

The data_availability property in FDv2 is missing an offline check, unlike target_availability which explicitly checks self._config.offline and returns DEFAULTS. In FDv1, both properties check for offline mode first. Without this check, if the store happens to be initialized while in offline mode, data_availability would return CACHED instead of DEFAULTS, creating inconsistent behavior between the two availability properties and between FDv1 and FDv2.

Fix in Cursor Fix in Web

@keelerm84 keelerm84 marked this pull request as draft December 4, 2025 15:09
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