Skip to content

feat: add FDv1 fallback directive parsing and TTL data model#1781

Open
joker23 wants to merge 2 commits into
mainfrom
skz/SDK-2619/fdv1-fallback-fix-fallback-directive-parsing
Open

feat: add FDv1 fallback directive parsing and TTL data model#1781
joker23 wants to merge 2 commits into
mainfrom
skz/SDK-2619/fdv1-fallback-fix-fallback-directive-parsing

Conversation

@joker23

@joker23 joker23 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

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 fallbackDirective helpers read x-ld-fd-fallback / x-ld-fd-fallback-ttl (seconds → ms, case-insensitive true, invalid TTL omitted, negatives clamped to indefinite 0) and protocolFallbackTTL on goodbye payloads for environments that cannot read stream headers (e.g. browser EventSource).

FDv2SourceResult change-set and status shapes plus changeSet, interrupted, terminalError, and goodbye now carry optional fdv1FallbackTtlMs (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.

@github-actions

Copy link
Copy Markdown
Contributor

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 26365 bytes
Compressed size limit: 29000
Uncompressed size: 129044 bytes

@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

@launchdarkly/js-client-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 38887 bytes
Compressed size limit: 39000
Uncompressed size: 212703 bytes

@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

@launchdarkly/browser size report
This is the brotli compressed size of the ESM build.
Compressed size: 179727 bytes
Compressed size limit: 200000
Uncompressed size: 831515 bytes

@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Compressed size: 32006 bytes
Compressed size limit: 34000
Uncompressed size: 114336 bytes

@joker23

joker23 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

@cursor review

cursor[bot]

This comment was marked as resolved.

@joker23

joker23 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ 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.

@joker23 joker23 marked this pull request as ready for review June 30, 2026 18:58
@joker23 joker23 requested a review from a team as a code owner June 30, 2026 18:58

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

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.

1 participant