You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When setProvider was first introduced, OpenFeature didn't have support for provider initialization. It was expected that a provider was initialized prior to registering it with OpenFeature. Since then, OpenFeature has added support for initialization so that the SDK could have an awareness of the provider lifecycle and is able to emit events that developers can subscribe to. Unfortunately, this meant that a provider may not be available immediately after registration. To overcome this, developers could wait for the provider ready event to fire before performing flag evaluations. A method called setProviderAndWait was also added that returned a promise. The promise resolves when the provider is ready or is rejected if there's an error during initialization.
We've received feedback that setProviderAndWait behaves the way people expect setProvider to work. Also, setProviderAndWait is not a good name in JavaScript because it does not block a thread as the name implies. For these reasons, setProvider should be updated to behave like setProviderAndWait and setProviderAndWait should be removed. This will be a breaking change that will require a v2.0.0 of the server SDK.
Requirements
setProvider returns a promise that's resolved when the provider is ready or is rejected if the provider fails during initialization.
Remove setProviderAndWait
Update the documentation in the readme
The text was updated successfully, but these errors were encountered:
Worth mentioning that this is how it works in the .NET SDK as well, since this change. This is relevant because .NET features basically the same async/await semantics as TS/JS.
Requirements
Overview
When
setProvider
was first introduced, OpenFeature didn't have support for provider initialization. It was expected that a provider was initialized prior to registering it with OpenFeature. Since then, OpenFeature has added support for initialization so that the SDK could have an awareness of the provider lifecycle and is able to emit events that developers can subscribe to. Unfortunately, this meant that a provider may not be available immediately after registration. To overcome this, developers could wait for the provider ready event to fire before performing flag evaluations. A method calledsetProviderAndWait
was also added that returned a promise. The promise resolves when the provider is ready or is rejected if there's an error during initialization.We've received feedback that
setProviderAndWait
behaves the way people expectsetProvider
to work. Also,setProviderAndWait
is not a good name in JavaScript because it does not block a thread as the name implies. For these reasons,setProvider
should be updated to behave likesetProviderAndWait
andsetProviderAndWait
should be removed. This will be a breaking change that will require av2.0.0
of the server SDK.Requirements
setProvider
returns a promise that's resolved when the provider is ready or is rejected if the provider fails during initialization.setProviderAndWait
The text was updated successfully, but these errors were encountered: