Skip to content

Conversation

@zhiyuanliang-ms
Copy link
Member

Why this PR?

Bug fix #447

Visible change

services.AddFeatureManagement()
            .AddFeatureFilter<TimeWindowFilter>();

The call of AddFeatureFilter on the IFeatureManagementBuilder returned by the AddFeatureManagement call will no longer register TimeWindowFilter repeatedly.

This PR added a check in the AddFeatureFilter<T>() method of the FeatureManagementBuilder class, if the T is TimeWindowFilter, the method will do nothing.

All built-in feature filters are registered during the AddFeatureManagement call, the TimeWindowFilter is registered through the overload `AddFeatureFilter(Func implemenetationFactory)

The FeatureManagementBuilder is internal and only be created in the AddFeatureManagment call, this ensures that AddFeatureFilter()` will only be called after calling AddFeatureManagement() where the TimeWindowFilter should have been registered.

@zhiyuanliang-ms zhiyuanliang-ms merged commit fca557a into main May 22, 2024
@zhiyuanliang-ms zhiyuanliang-ms deleted the zhiyuanliang/fix-3.3.0-bug branch May 22, 2024 00:20
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.

Nuget "Microsoft.FeatureManagement.AspNetCore" Version 3.3.0 - Multiple feature filters match the configured filter named 'Microsoft.TimeWindow'

3 participants