Skip to content

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

Open
wants to merge 1 commit into
base: ta/fdv2-temporary-holding
Choose a base branch
from

Conversation

tanderson-ld
Copy link
Contributor

@tanderson-ld tanderson-ld commented May 1, 2025

Requirements

  • I have added test coverage for new or changed functionality
    Need to add one test for ignoring basis==false, empty payloads.
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

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.

@tanderson-ld tanderson-ld requested a review from a team as a code owner May 1, 2025 21:24
@@ -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);
Copy link
Contributor Author

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) => {
Copy link
Contributor Author

@tanderson-ld tanderson-ld May 1, 2025

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;
}

Copy link
Contributor Author

@tanderson-ld tanderson-ld May 1, 2025

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

Copy link
Contributor Author

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.

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