fix: Support the v2 harness persistence config shape and daemon mode in the contract test service - #2047
Open
joker23 wants to merge 3 commits into
Conversation
joker23
added this pull request to stack #2014
September 24, 2026 16:30
Contributor
|
@launchdarkly/js-sdk-common size report |
Contributor
|
@launchdarkly/js-client-sdk size report |
Contributor
|
@launchdarkly/js-client-sdk-common size report |
joker23
force-pushed
the
skz/sdk-3083/persistent-store-write-back-recovery-contract-fixes
branch
from
September 24, 2026 22:17
56b3536 to
4bc7ae9
Compare
joker23
force-pushed
the
skz/sdk-3083/persistent-store-write-back-recovery-contract-fixes
branch
from
September 25, 2026 14:55
4bc7ae9 to
1f50641
Compare
joker23
force-pushed
the
skz/sdk-3083/persistent-store-write-back-recovery-contract-fixes
branch
from
September 25, 2026 16:25
1f50641 to
1882e76
Compare
joker23
force-pushed
the
skz/sdk-3083/persistent-store-write-back-recovery-contract-fixes
branch
2 times, most recently
from
September 25, 2026 18:26
63b9615 to
be9c442
Compare
joker23
force-pushed
the
skz/sdk-3083/persistent-store-write-back-recovery-contract-fixes
branch
from
September 25, 2026 19:43
be9c442 to
ae114e1
Compare
joker23
force-pushed
the
skz/sdk-3083/persistent-store-write-back-recovery-contract-fixes
branch
from
September 25, 2026 21:12
ae114e1 to
d1e36a1
Compare
joker23
force-pushed
the
skz/sdk-3083/persistent-store-write-back-recovery-contract-fixes
branch
from
September 28, 2026 21:02
d1e36a1 to
8ab31d4
Compare
joker23
force-pushed
the
skz/sdk-3083/persistent-store-write-back-recovery-contract-fixes
branch
2 times, most recently
from
September 28, 2026 21:40
22a7c85 to
cb43b4c
Compare
joker23
force-pushed
the
skz/sdk-3083/persistent-store-write-back-recovery-contract-fixes
branch
from
September 28, 2026 22:16
cb43b4c to
eb17a6e
Compare
joker23
force-pushed
the
skz/sdk-3083/persistent-store-write-back-recovery-contract-fixes
branch
from
September 28, 2026 23:23
eb17a6e to
c839a6c
Compare
joker23
force-pushed
the
skz/sdk-3083/persistent-store-write-back-recovery-contract-fixes
branch
from
September 28, 2026 23:26
c839a6c to
1298c42
Compare
joker23
force-pushed
the
skz/sdk-3083/persistent-store-write-back-recovery-contract-fixes
branch
2 times, most recently
from
September 29, 2026 15:22
c974a03 to
c727bd2
Compare
joker23
force-pushed
the
skz/sdk-3083/persistent-store-write-back-recovery-contract-fixes
branch
from
September 29, 2026 16:19
c727bd2 to
13b6d2a
Compare
joker23
marked this pull request as ready for review
September 29, 2026 16:21
Contributor
There was a problem hiding this comment.
Devin Review found 1 potential issue.
2 flags not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The contract test service only read the persistence configuration from the FDv2 shape (
dataSystem.store.persistentDataStore). The v2 test harness sends it at the top level of the SDK configuration, so no persistent store was constructed at all under that harness: the SDK ran on the in-memory store, the$initedmarker was never written, and every read-write persistence test failed.persistentDataStoreconfiguration and map it to the FDv1featureStoreoption. One code path serves both the Redis and DynamoDB store types.useLdd). This is the faithful translation of the harness's store-without-sources configuration, matches the Go test service (ExternalUpdatesOnly), and stops the entity from dialing production LaunchDarkly with the test credential in those scenarios.readyevent before handing it to the store. The entity disables the offline queue, so commands sent before the connection is ready fail immediately and can race the SDK's first writes.Verified locally against the full v2 and v3 harness suites with Redis and DynamoDB running: all persistence tests pass (v2) or are explicitly suppressed (v3 no-data-source set).
Note
Overview
Fixes the Node server contract-test entity so v2 harness persistence scenarios work: it now reads top-level
persistentDataStore(not onlydataSystem.store) and maps it to FDv1featureStore, withuseLddwhen there is a store but no streaming/polling (daemon mode).Redis persistence is built with an explicit
ioredisclient (new dependency), waits forreadybefore the SDK writes, andcloseStoretears down the connection on client shutdown or init failure. DynamoDB setsmaxAttempts: 1so harness outage simulations aren’t masked by AWS retries.makeSdkConfigis async and returns{ config, closeStore }; FDv2 paths also enabledataSystem.useLddwhen there are zero data sources.Reviewed by Cursor Bugbot for commit 76b1caf. Bugbot is set up for automated code reviews on this repo. Configure here.