Skip to content

Conversation

@jsonbailey
Copy link
Contributor

@jsonbailey jsonbailey commented Jan 23, 2026

Note

Medium Risk
Touches client initialization/evaluation readiness logic and FDv2 polling request headers, which can change runtime behavior in production paths if incorrect, though most other changes are confined to contract-test harness code/CI.

Overview
Enables running both FDv2 and early FDv3 contract test suites in CI by updating the composite check action to run contract tests twice (keeping the service running between runs).

Updates the Ruby contract test service/client to understand the new dataSystem configuration shape (initializers/synchronizers, FDv1 fallback, payload filter, and nested persistent store settings), refactors time conversions, and adds persistent-store mode mapping for FDv2. Adjusts local dev server binding/host authorization for the test service, updates FDv2 polling header names to X-LD-*, and changes LDClient#initialized?/evaluation gating to treat cached store data as initialized while still distinguishing REFRESHED vs CACHED during evaluation.

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

@jsonbailey jsonbailey requested a review from a team as a code owner January 23, 2026 22:54
LD_ENVID_HEADER = "x-launchdarkly-env-id"
LD_FD_FALLBACK_HEADER = "x-launchdarkly-fd-fallback"
LD_ENVID_HEADER = "X-LD-EnvID"
LD_FD_FALLBACK_HEADER = "X-LD-FD-Fallback"
Copy link

Choose a reason for hiding this comment

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

Header lookup fails due to case mismatch

High Severity

The LD_ENVID_HEADER and LD_FD_FALLBACK_HEADER constants were changed from lowercase ("x-launchdarkly-env-id", "x-launchdarkly-fd-fallback") to mixed-case ("X-LD-EnvID", "X-LD-FD-Fallback"). However, HTTP response headers are explicitly downcased via transform_keys(&:downcase) when constructing response_headers. Since Ruby hash lookups are case-sensitive, lookups using these mixed-case constants against the all-lowercase headers hash will always return nil, breaking fallback detection and environment ID retrieval.

Fix in Cursor Fix in Web

@jsonbailey jsonbailey marked this pull request as draft January 23, 2026 23:39
@jsonbailey jsonbailey marked this pull request as ready for review January 28, 2026 16:26
stale_after: stale_after_ms
)
big_config[:context_cache_size] = big_segments[:userCacheSize] if big_segments[:userCacheSize]
set_optional_time_prop(big_segments, :userCacheTimeMs, big_config, :context_cache_time)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updating to use the new set_optional_time_prop method

context1 == context2
end

def secure_mode_hash(params)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved non private methods above the private methods.

Copy link
Member

@keelerm84 keelerm84 left a comment

Choose a reason for hiding this comment

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

Seems fine to me (minus my one comment and whatever the bot is grumpy about).

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.

@jsonbailey jsonbailey merged commit 2ffe4e9 into main Jan 29, 2026
10 checks passed
@jsonbailey jsonbailey deleted the jb/sdk-1549/update-contract-tests-for-fdv2 branch January 29, 2026 15:08
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