chore: schedule FDv2 recovery orchestration after fallback TTL expires - #1857
Conversation
b3def90 to
bb71b36
Compare
50a8250 to
4209e07
Compare
|
@launchdarkly/js-sdk-common size report |
bb71b36 to
b3def90
Compare
4209e07 to
50a8250
Compare
b3def90 to
ad07e81
Compare
50a8250 to
6ef2c4f
Compare
createFDv2RecoveryCondition was removed from Conditions.ts in PR #1856; this drops the now-broken caller and its config/tracking from FDv2DataSource.ts.
|
@launchdarkly/js-client-sdk-common size report |
|
@launchdarkly/browser size report |
|
@launchdarkly/js-client-sdk size report |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 63d2f3d. Configure here.
|
Folding this into #1856. After removing the Condition-based FDv2 recovery primitive per review (#1856 (comment)), this layer's only remaining content was the FDv1-fallback re-trigger guard in |
Summary
Wires the FDv2-recovery primitives from the previous PR in this stack into
FDv2DataSource's synchronizer run loop: after falling back to FDv1, a recovery condition races alongside the existing fallback/recovery conditions, using the server-supplied TTL (or a caller-configurable override, or a 1-hour default if absent -- a TTL of0means indefinite, no recovery scheduled).On firing,
SourceManager.fdv2Recovery()re-enables FDv2 and the loop naturally attempts a fresh FDv2 connection -- if the server still signals fallback on that attempt, fallback re-engages from the new result. Also guards against the FDv1 synchronizer's own results re-triggering the fallback machinery. Ships with regression tests covering TTL present/absent/zero and the no-re-trigger guard.Note
Overview
Adds a guard in
handleFdv1Fallbackso when the active synchronizer is already the FDv1 fallback slot, results that still carryfdv1Fallbackno longer callsourceManager.fdv1Fallback()again. That stops redundant fallback churn (e.g. spinning FDv2 back up or re-blocking slots) while the SDK is already on FDv1.A regression test (SDK-2617) covers FDv2 signaling fallback, then the FDv1 synchronizer emitting both fallback-flagged and normal changeSets, and asserts FDv2 is only created once and both FDv1 payloads are delivered.
Also clarifies the synchronizer loop comment: condition timers must be closed on throw or early break, not only on normal paths.
Reviewed by Cursor Bugbot for commit 63d2f3d. Bugbot is set up for automated code reviews on this repo. Configure here.