-
Notifications
You must be signed in to change notification settings - Fork 45
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
Config-cat-web not forwarding default value to client #1213
Comments
I don't think this is intended but looks like a bug since e.g. the .NET provider forwards the default value. |
After taking a deeper look, I'm no longer sure that this is an actual issue with the provider. The thing is that the underlying ConfigCat SDK returns the default value passed to it in only one case: when an error occurs during feature flag evaluation. In that case, however, config-cat-web-provider always throws an error: https://github.com/open-feature/js-sdk-contrib/blob/config-cat-provider-v0.7.2/libs/providers/config-cat-web/src/lib/config-cat-web-provider.ts#L133 (A successful evaluation never returns That is, in the case of config-cat-web provider, you either get a successful One thing I'm not sure about is whether it's correct to throw an error in case the underlying provider reports an error. For example, the LaunchDarkly provider returns @lukas-reining Could you tell us which one is the desired behavior? |
Hey thanks for having a look @adams85! To the question regarding throw vs return: We decided that we do not prefer the providers to return error resolutions themselves. This is actually a proposed breaking change for a possible 2.0 release in the future. This makes error handling for the I think we could use I can open a PR tomorrow if you like @adams85. [1] https://github.com/open-feature/js-sdk-contrib/pull/334/files#diff-b591f9f22e8f3b5c4eb5ce9c3d54cf28d36ba85b744ea55c2d5d2f1b1e561b46R48 |
…re#1213) Signed-off-by: Adam Simon <[email protected]>
…re#1213) Signed-off-by: Adam Simon <[email protected]>
Hi @lukas-reining,
Thank you for clearing this up.
Agreed, so I went ahead and made a proposal on how to do this. Feel free to add your suggestions. |
…re#1213) Signed-off-by: Adam Simon <[email protected]>
Had a look and it looks good @adams85. Only the formatting and import paths have to be fixed for the linting to work. |
Trying to debug #1212, I realized that config-cat-web-provider is not passing the default value to the underlying client. It's always passing undefined.
Is this a bug or is it expected behaviour? Even on the screenshot of #1212, you can see that the defaultValue evaluated is undefined, although in the example repo I passed false
The text was updated successfully, but these errors were encountered: