fix(v2/featureflag): skip caching error evaluation results

Context

Follow-up to !399 (merged) which added LRU evaluation caching to the feature flag client.

What's in this MR?

The caching provider previously cached all evaluation results unconditionally, including error results from transient provider failures (e.g. Flipt timeout, connection refused). This meant a brief outage could poison the cache for the full TTL, preventing recovery even after the provider comes back.

This MR adds a result.Error() == nil guard to both BooleanEvaluation and StringEvaluation so that only successful evaluations are cached. Error results always delegate to the inner provider on the next call.

Also renames err to keyErr in both methods to clarify that the variable guards cache key serialization, not the evaluation result.

How it works

The OpenFeature Go SDK communicates provider errors in-band via ProviderResolutionDetail.Error(), which returns nil when ResolutionError has an empty code (success) and a non-nil error otherwise. The Flipt provider sets NewGeneralResolutionError(err.Error()) on any svc.Boolean() failure.

Merge request reports

Loading
Loading