Skip to content

No possibility to run contextual filters when calling GetVariantAsync #485

@zhiyuanliang-ms

Description

@zhiyuanliang-ms

The current signature of IVariantFeatureManager.GetVariantAsync is

ValueTask<Variant> GetVariantAsync(string feature, TargetingContext context, CancellationToken cancellationToken = default);

It accepts the parameter of type TargetingContext.

For contextual feature filter:

public interface IContextualFeatureFilter<TContext> : IFeatureFilterMetadata
{
    Task<bool> EvaluateAsync(FeatureFilterEvaluationContext featureFilterContext, TContext appContext);
}

They can use any type of context for evaluation. When calling GetVariantAsync, the contextual feature filter which requires context of types othen than TargetingContext is unuseable.

We need to change the GetVariantAsync to accept parameter of ITargetingContext.

Metadata

Metadata

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