feat: add FDv1 fallback directive parsing and TTL data model#1781
feat: add FDv1 fallback directive parsing and TTL data model#1781joker23 wants to merge 2 commits into
Conversation
|
@launchdarkly/js-sdk-common size report |
|
@launchdarkly/js-client-sdk-common size report |
|
@launchdarkly/browser size report |
|
@launchdarkly/js-client-sdk size report |
|
@cursor review |
|
@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 b232737. Configure here.
first set of changes to let client side fdv2 handle fdv1 fallback ttl. This PR adds logic to read FDv1 fallback values from both header and goodbye body.
Note
Medium Risk
Touches FDv2→FDv1 fallback signaling and TTL semantics on the data-source path; behavior is mostly additive parsing and types until orchestrators consume it, but incorrect TTL handling could affect recovery timing.
Overview
Adds shared parsing for when the server tells FDv2 clients to fall back to FDv1 and how long to stay there before retrying FDv2.
New
fallbackDirectivehelpers readx-ld-fd-fallback/x-ld-fd-fallback-ttl(seconds → ms, case-insensitivetrue, invalid TTL omitted, negatives clamped to indefinite0) andprotocolFallbackTTLon goodbye payloads for environments that cannot read stream headers (e.g. browserEventSource).FDv2SourceResultchange-set and status shapes pluschangeSet,interrupted,terminalError, andgoodbyenow carry optionalfdv1FallbackTtlMs(undefined= caller default,0= indefinite). Tests cover directive parsing and goodbye result construction.Reviewed by Cursor Bugbot for commit b232737. Bugbot is set up for automated code reviews on this repo. Configure here.