Skip to content

[Flipt Provider]Default variant metadata not returned when request not hit variant of a flag #1669

Description

@Rufei77

Hey there,

My team's adopting the latest Flipt provider sdk version 0.1.3.

We try to get variant attachment for requests which do not hit any variant. The rules we defined work as expected via Flipt Playground on Flipt UI and via Flipt API call, but failed via Flipt provider sdk.

According to Flipt UI, the response should fallback to the default variant and get its metadata including the attachment.

Image

However, it does not work as expected on Flipt UI. Instead, it returns only "null" value.

// response not as expected
:FlagEvaluationDetails(flagKey=my_flag_key, value=null, variant=null, reason=DEFAULT, errorCode=null, flagMetadata=dev.openfeature.sdk.ImmutableMetadata@xx)

The issue is possibly caused by the code logic here

Expectation:
GIVEN a variant flag is created and rules with default rule are defined
WHEN a request with context does not hit any variant of a flag
THEN the metadata of the default variant should be returned

Code to reproduce:

FlagEvaluationDetails<Value> flagEvaluationDetails = client.getObjectDetails(flagKey, null, evaluationContext);
ImmutableMetadata configMeta = flagEvaluationDetails.getFlagMetadata();

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions