Skip to content

[BUG] useFlag hooks display stale EvaluationDetails when flag value unchanged but metadata differs #1286

@beeme1mr

Description

@beeme1mr

Observed behavior

When a flag is re-evaluated and the value remains the same but other EvaluationDetails fields change (e.g., reason, errorCode, variant, flagMetadata), components using useFlag or related hooks continue to display the old EvaluationDetails instead of the updated metadata.

Expected Behavior

Components should re-render and display updated EvaluationDetails whenever any field changes, not just the value.

Steps to reproduce

  1. Set up a React component using useBooleanFlagDetails (or similar hook)
  2. Mount the component while the provider is NOT_READY (flag evaluates with reason: "ERROR", errorCode: "PROVIDER_NOT_READY")
  3. Wait for the provider to become READY (same flag value but now reason: "STATIC", no error code)
  4. Observe that the component's EvaluationDetails still shows reason: "ERROR" instead of reason: "STATIC"

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions