Skip to content

fix: Correct logic for evaluation blocked for ERROR and STALE providers#96

Open
NeaguGeorgiana23 wants to merge 2 commits into
mainfrom
fix_provider_evaluation
Open

fix: Correct logic for evaluation blocked for ERROR and STALE providers#96
NeaguGeorgiana23 wants to merge 2 commits into
mainfrom
fix_provider_evaluation

Conversation

@NeaguGeorgiana23
Copy link
Copy Markdown
Contributor

This PR

Fixes the flag evaluation which was incorrectly blocked when the feature provider was in ERROR or STALE states.

Previously, the SDK short-circuited evaluation for any provider status other than READY. This PR updates the EvaluateFlag logic to strictly follow the OpenFeature specification by:

  • Short-circuiting and returning the PROVIDER_NOT_READY error code only when the provider is NOT_READY (Requirement 1.7.6).
  • Short-circuiting and returning the PROVIDER_FATAL error code only when the provider is in a FATAL error state (Requirement 1.7.7).
  • Allowing evaluation to proceed for READY, ERROR, and STALE states, ensuring cached values can still be returned when appropriate.

Related Issues

Fixes #69

Notes

  • Implements compliance for OpenFeature specification Requirements 1.7.6 and 1.7.7.
  • Remaining minor bugs from the tracking issue will be addressed in subsequent PRs.

Follow-up Tasks

  • Address remaining minor bugs in the compliance tracking issue

Signed-off-by: NeaguGeorgiana23 <neagugeorgiana@google.com>
@NeaguGeorgiana23 NeaguGeorgiana23 requested review from a team as code owners May 11, 2026 07:23
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the EvaluateFlag method in ClientAPI to explicitly handle different provider statuses. It replaces the generic non-ready check with specific logic for ProviderStatus::kNotReady and ProviderStatus::kFatal, ensuring that a fatal provider state returns the appropriate ErrorCode::kProviderFatal. I have no feedback to provide as there were no review comments to evaluate.

Signed-off-by: NeaguGeorgiana23 <neagugeorgiana@google.com>
@NeaguGeorgiana23 NeaguGeorgiana23 changed the title Correct logic for evaluation blocked for ERROR and STALE providers fix: Correct logic for evaluation blocked for ERROR and STALE providers May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Specification Compliance Review

2 participants