Repository navigation
fix(configcat)!: report evaluation errors instead of a silent default - #1964
RaphaelFakhri wants to merge 2 commits into
Conversation
Signed-off-by: Raphael Fakhri <153192858+RaphaelFakhri@users.noreply.github.com>
|
Hi @RaphaelFakhri, thanks for this PR! In the |
…r codes Bump configcat-java-client to 10.1.0, which exposes the error code on EvaluationDetails, and use it instead of probing getAllKeys(). Signed-off-by: RaphaelFakhri <153192858+RaphaelFakhri@users.noreply.github.com>
|
@z4kn4fein thanks, switched to it in 8b24351. The provider now bumps
That also takes care of the extra fetch on the error path and the empty override map case CodeRabbit flagged. The error result now returns the caller's default value too, so a direct One thing for the maintainers: going from 9.x to 10.x pulls in the 10.0.0 breaking change that removed |
|
@RaphaelFakhri great, thank you for the update! I think the options change should be flagged as breaking, and the bump can remain in this PR. |
|
@z4kn4fein Done. The PR title is now |
This PR
EvaluationDetails.getErrorCode()after each ConfigCat evaluation. When ConfigCat reports an error, the provider now returns the default value withreason=ERROR, the ConfigCat error message, and an error code.EvaluationErrorCodeto the OpenFeature error code (FLAG_NOT_FOUND,TYPE_MISMATCH,PARSE_ERROR, orGENERAL).Before this change, a missing or mistyped flag returned the default with no error code or reason, so error hooks did not run and the evaluation looked successful.
Related Issues
Fixes #1963
Notes
Bumps
configcat-java-clientfrom 9.4.4 to 10.1.0, which addsEvaluationDetails.getErrorCode(). The provider maps it as follows:SETTING_KEY_MISSINGtoFLAG_NOT_FOUND,SETTING_VALUE_TYPE_MISMATCHtoTYPE_MISMATCH,INVALID_CONFIG_MODELtoPARSE_ERROR, and anything else toGENERAL.Breaking change
configcat-java-client10.0.0 removed the option to set a customOkHttpClient(ConfigCatClient.Options.httpClient(...)). Code that sets one throughConfigCatProviderConfig.options(...)no longer compiles. HTTP timeouts and the HTTP proxy are now set through the newHttpOptions. The PR title carries!so release-please treats this as a breaking change.Follow-up Tasks
The client
onErrorhook also fires for evaluation errors such as a missing flag. Each one emitsPROVIDER_ERROR, so the provider state flips betweenREADYandERROR. This PR does not change that.How to test
missingFlagReportsFlagNotFoundfails onmainwithexpected: <FLAG_NOT_FOUND> but was: <null>and passes with this change.BREAKING CHANGE:
configcat-java-client10.x removes the option to set a customOkHttpClientinConfigCatProviderConfig.options(...). UseHttpOptionsfor HTTP timeouts and the HTTP proxy.