-
Notifications
You must be signed in to change notification settings - Fork 31
feat: falls back to FDv1 polling if flag delivery sends fallback header #832
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: falls back to FDv1 polling if flag delivery sends fallback header #832
Conversation
|
Added @keelerm84 as he is privy to the expected behavior. |
packages/shared/sdk-server/src/data_sources/PollingProcessorFDv2.ts
Outdated
Show resolved
Hide resolved
| "@launchdarkly/js-server-sdk-common": "2.10.0", | ||
| "https-proxy-agent": "^5.0.1", | ||
| "launchdarkly-eventsource": "2.0.3" | ||
| "launchdarkly-eventsource": "2.2.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reviewers: This adds support for getting header from event source.
| const payload = data.payloads[0]; | ||
|
|
||
| switch (payload?.code) { | ||
| switch (payload?.intentCode) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reviewers: Tweak following integration testing with FD team.
| ], | ||
| }, | ||
| }, | ||
| ]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reviewers: id and target don't matter for this case since it is a xfer full.
| }; | ||
|
|
||
| const DEFAULT_POLL_INTERVAL = 30; | ||
| export const DEFAULT_POLL_INTERVAL = 30; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reviewers: Used by LDClientImpl for FDv1 fallback polling interval.
Requirements
Will validate on holding branch later.
Related issues
SDK-1179
Describe the solution you've provided
Adds FDv1 fallback error type. FDv2 datasources now report that error type if they see the fallback header from the FDv2 endpoints.
Updates FDv2 polling datasource to support being constructed in a FDv1 to FDv2 conversion mode. In that mode, the response from an FDv1 endpoint will be converted to an FDv2 payload and passed through the FDv2 payloadProcessor.
CompositeDataSource now supports an FDv1 fallback synchronizer list. If any datasource reports the FDv1 fallback error, the CompositeDataSource switches to use the fallback synchronizer list.
This PR also contains tweaks to get the holding branch working with the latest contract tests that got some tweaks during recent integration testing.