-
Notifications
You must be signed in to change notification settings - Fork 21
feat: now utilizes FDv2 basis param for more efficient polling #843
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
base: ta/fdv2-temporary-holding
Are you sure you want to change the base?
feat: now utilizes FDv2 basis param for more efficient polling #843
Conversation
@@ -107,14 +107,14 @@ export class EdgeFeatureStore implements LDFeatureStore { | |||
} | |||
|
|||
init(allData: LDFeatureStoreDataStorage, callback: () => void): void { | |||
this.applyChanges(true, allData, undefined, callback); | |||
this.applyChanges(true, allData, callback, undefined); |
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.
Selector now optional, so swapped to end of args. This happens in quite a few spots in this PR.
callback: () => void, | ||
selector?: string, | ||
): void { | ||
const checkForChanges = this._hasEventListeners(); | ||
const doApplyChanges = (oldData: LDFeatureStoreDataStorage) => { |
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 block of changes was mostly formatting of the params and selector moving to after the callback. Ignore whitespace helps.
}, sleepFor); | ||
return; | ||
} | ||
|
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 change was made so that when 304 was received, we would not error since the requestor does not return a body in that case. This now more closely matches existing logic in PollingProcessor (v1).
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 file was still using the older feature store APIs, now requires using the newer applyChanges API to include the selector.
Requirements
Need to add one test for ignoring basis==false, empty payloads.
Related issues
SDK-1044
Describe the solution you've provided
Pipes selector through datasource and feature store layers / APIs. InMemoryFeatureStore holds the selector in memory at runtime. When datasources need the selector for making their requests, they invoke a selectorGetter lambda that is hooked up to the InMemoryFeatureStore.