Ability to set configuration request parameters on an already instantiated client instance #37
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ποΈ Ticket: (Eppo Internal) FF-1557 - JS Client SDK should return null when not initialized
π― Related PR:
eppo-client-sdk
#48Motivation and Context
Using
EppoRandomizationProvider
withoutwaitForInitialization = true
or any other JavaScript pattern where initialization of the client is notawait
ed, could result in somegetInstance()
andgetAssignment()
calls on an uninitialized instance.Previous changes to
js-client-sdk
made it so that it threw an error (link). However, we want to revert to the behavior of returningnull,
which this PR does (but now with a warning) on calls togetAssignment()
.To accomplish this, we need to revert to having a default initialized instance (link to where that was changed) that is later populated during initialization.
Description
To allow upstream-created client instances to set configuration request parameters, we provide a new method:
setConfigurationRequestParameters()
.I also renamed the internal variables to
configurationRequestParameters
to more consistent and not have "config" in them twice.How has this been tested?
eppo-client.spec.ts
js-client-sdk
andnode-server-sdk
repositories usingmake prepare
andyarn add --force --file:../js-client-sdk-common