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

Low Risk
Additive types and parsing with tests; no orchestrator or runtime behavior changes in this diff.

Overview
Adds shared parsing for server-directed FDv1 fallback and how long to stay on FDv1 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) and protocolFallbackTTL on goodbye payloads for clients that cannot read stream headers (e.g. browser EventSource).

FDv2SourceResult now carries optional fdv1FallbackTtlMs on change-set and status results; factory helpers (changeSet, interrupted, terminalError, goodbye) accept the same TTL semantics (undefined = caller default, 0 = indefinite).

Reviewed by Cursor Bugbot for commit c902a80. 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

@joker23 joker23 force-pushed the skz/SDK-2619/fdv1-fallback-fix-fallback-directive-parsing branch from b232737 to 10296f6 Compare July 9, 2026 17:37
@joker23 joker23 force-pushed the skz/SDK-2619/fdv1-fallback-fix-fallback-directive-parsing branch from 10296f6 to c902a80 Compare July 13, 2026 15:55

@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 found 1 new potential issue.

View 3 additional findings in Devin Review.

Open in Devin Review

Comment thread packages/shared/sdk-client/src/datasource/fdv2/fallbackDirective.ts
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