Comments (8)
@zhiyuanliang-ms Yes, now it works perfectly! Many thanks!
from featuremanagement-dotnet.
Microsoft.FeatureManagement
3.3.1 has been released.
from featuremanagement-dotnet.
What version did you upgrade from, and is the same setup working with the old version?
from featuremanagement-dotnet.
Hi, @davidstarkcab
I have reproduced the bug. This bug is introduced by 3.3.0. Sorry for the inconvenience.
The reason of this bug is that in v3.3.0, we enhance the TimeWindowFilter
to support recurrence settings. To optimize the recurring time window evaluation, we used a memory cache in TimeWindowFilter
, which cause the registeration of TimeWindowFilter
is slightly different from other built-in filters. We used a new overload of AddFeatureFilter
method. This caused TimeWindowFilter
being registered multiple times and the feature manager will get duplicated filter metadata of it. Then, AmbiguousFeatureFilter exception is thrown.
To resolve your problem, please downgrade to 3.2.0 or you can change this line
builder.Services.AddFeatureManagement().AddFeatureFilter<ContextualTargetingFilter>().AddFeatureFilter<TimeWindowFilter>().AddFeatureFilter<PercentageFilter>();
to
builder.Services.AddFeatureManagement();
Starting from 3.0.0, ContextualTargetingFilter
, TimeWindowFilter
and PercentageFilter
are registered within the AddFeatureManagement
call. For more details, see here
So you no longer need to register them by yourself. We mention this in the public doc and also in the README.
In the README, we said
There a few feature filters that come with the
Microsoft.FeatureManagement
package:PercentageFilter
,TimeWindowFilter
,ContextualTargetingFilter
andTargetingFilter
. All filters, except for theTargetingFilter
, are added automatically when feature management is registered.
This is a mistake, I should bold this to catch more eyes. I will update the README and fix the bug soon.
from featuremanagement-dotnet.
What version did you upgrade from, and is the same setup working with the old version?
3.2.0 and its the same setup
from featuremanagement-dotnet.
@zhiyuanliang-ms Thanks!
from featuremanagement-dotnet.
Our previous way to avoid duplicated registeration is to check the implementationType of existing ServiceDescriptor in the service collection.
Now, time window filter is registered through implementationFactory, its descriptor's implementationType is null.
ServiceDescriptor doesn't allow us to set implementationType while using implementationFactory.
https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.dependencyinjection.servicedescriptor?view=net-6.0
I didn't come up a graceful solution. Currently, I have two was in my mind:
- Breaking change (We may adopt this in v4)
Remove the public Cache property of TimeWindowFilter and put it into the constructor
Remove the overload of AddFeatureFilter(Func)
- Work around
Ignore TimeWindowFilter in AddFeatureFilter()
The FeatureManagementBuilder is internal, so our implementation of AddFeatureFilter() will only be called after calling AddFeatureManagement() where the TimeWindowFilter should have been registered
from featuremanagement-dotnet.
Hi, @davidstarkcab
Have you tried removing all AddFeatureFilter
calls to register built-in feature filters? Did it work for you?
from featuremanagement-dotnet.
Related Issues (20)
- The TargetingId should be included in the FeatureEvaluation event even if it's null/empty. HOT 5
- Targeting evaluation is CPU dependent. HOT 4
- Remove the support for variants and telemetry from the .NET feature flag schema HOT 14
- Include Targeting Information on outgoing telemetry HOT 2
- Support .NET 8 Targeting framework in Microsoft.FeatureManagement.Telemetry.ApplicationInsights.AspNetCore
- Target netstandard2.* in Microsoft.FeatureManagement.Telemetry.ApplicationInsights
- The approach to telemetry (using custom `ITelemetryPublisher`) seems overengineered and counter to modern OpenTelemetry abstractions HOT 37
- Add Default Http Targeting Context Accessor
- Consider moving `TargetingHttpContextMiddleware` to the App Insights package HOT 3
- No instance of ITargetingContextAccessor is available for variant assignment. HOT 6
- FeatureManagerSnapshot should snapshot TargetingContext as well
- EvaluationDataToApplicationInsights example
- Can't Set FeatureFilters In FeatureManager In .NET Framework Application HOT 10
- Update Package metadata
- Add a link to preview on main readme HOT 1
- Cannot use the TargetingFilter in .NET class library project HOT 3
- Consider using `TimeProvider` using Microsoft.Bcl.TimeProvider nuget package HOT 2
- Bug 4.0.0-preview: NullReferenceException when TargetingContext.UserId is null and TargetingEvaluationOption.IgnoreCase = true
- Consider the ability to allocate variants based on custom filters HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from featuremanagement-dotnet.