Skip to content
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

chore: preparation work for FDv2 feature store and persistence support #725

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

Conversation

tanderson-ld
Copy link
Contributor

@tanderson-ld tanderson-ld commented Jan 7, 2025

Splitting these changes up into multiple PRs to keep them manageable and because we can't merge directly to main as applyChanges is dependent on transaction support in the PersistentDataStore.

Existing tests are exercising applyChanges, but through init, upsert, and delete. Plan to add applyChanges tests in ta/fdv2-temporary-holding after transaction support is added to PersistentDataStore in a subsequent PR as part of SDK-1029

Copy link
Contributor

github-actions bot commented Jan 7, 2025

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Size: 19014 bytes
Size limit: 21000

Copy link
Contributor

github-actions bot commented Jan 7, 2025

@launchdarkly/js-client-sdk-common size report
This is the brotli compressed size of the ESM build.
Size: 15354 bytes
Size limit: 20000

Copy link
Contributor

github-actions bot commented Jan 7, 2025

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Size: 19814 bytes
Size limit: 21000

@tanderson-ld tanderson-ld changed the base branch from main to ta/fdv2-temporary-holding January 9, 2025 17:41
@tanderson-ld tanderson-ld marked this pull request as ready for review January 9, 2025 20:24
@tanderson-ld tanderson-ld requested a review from a team as a code owner January 9, 2025 20:24
@tanderson-ld tanderson-ld changed the title chore: preparation work for FDv2 support chore: preparation work for FDv2 feature store and persistence support Jan 9, 2025
this._featureStore.get(kind, key, doUpsert);
} else {
doUpsert();
}
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: upsert and init have been combined and the distinction is now driven by the bool basis.

[VersionedDataKinds.Features.namespace]: oldFlags,
[VersionedDataKinds.Segments.namespace]: oldSegments,
};
doInit(oldData);
});
});
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: These all calls feel a bit off, but without a refactoring of layer responsibility, I don't see a change that is worth the effort. Thoughts?

} else {
items[key] = item;
}
}
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 logic has moved into apply changes.

}
});
});
}
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: Guts of this logic comes from _addItem at the top of this file. Small tweaks from there.

});
_callback();
}
}
Copy link
Contributor Author

@tanderson-ld tanderson-ld Jan 9, 2025

Choose a reason for hiding this comment

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

For reviewers: This code is not shippable (why this PR is going to a temp branch) due to the intermediate states potentially being invalid, but this temporary code allows contract tests not checking intermediate state to pass.

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