Giter Club home page Giter Club logo

Comments (8)

hilljaycie14 avatar hilljaycie14 commented on June 9, 2024 1

Thank you all for your quick responses, it is greatly appreciated!

@jimmyca15

@hilljaycie14 You reference an example feature "TEST-123". What filters is that feature registered to use?

The registration is as follows, some code omitted for privacy concerns:

return services.AddFeatureManagement()
               .AddFeatureFilter<MyContextualFilter>()
               .AddFeatureFilter<MyFeatureFilter>()

@zhiyuanliang-ms thank you for your workaround && getting a quick PR up! Greatly appreciated!

from featuremanagement-dotnet.

zhiyuanliang-ms avatar zhiyuanliang-ms commented on June 9, 2024 1

@MoazAlkharfan Yes, this is a breaking change. This PR #314 fixed it. We are going to release 3.1.0 in the following days. 3.1.0 will include bug fix and some other new features.

from featuremanagement-dotnet.

zhiyuanliang-ms avatar zhiyuanliang-ms commented on June 9, 2024 1

Fixed in release 3.1.0

from featuremanagement-dotnet.

jimmyca15 avatar jimmyca15 commented on June 9, 2024

@hilljaycie14 You reference an example feature "TEST-123". What filters is that feature registered to use?

from featuremanagement-dotnet.

jimmyca15 avatar jimmyca15 commented on June 9, 2024

@hilljaycie14 I took a look and here's what I've found.

Version 3.0 has introduced a behavior change, perhaps one we can consider a regression/bug.

In version 2.6.1 it was fine for a feature to reference a contextual feature filter and not use it. The system would detect that the contextual filter referenced does exist, but since no app context was provided it would simply ignore evaluating the contextual filter. It's debatable whether or not this was the right behavior to be implemented, but nonetheless it's how it worked.

v3.0 changed this. Now, if a contextual filter is referenced, but no context that can be used for the filter is passed, then the system errors.

At a glance, it seems we should allow things to work as they did in 2.6.1

@zhiyuanliang-ms

from featuremanagement-dotnet.

zhiyuanliang-ms avatar zhiyuanliang-ms commented on June 9, 2024

@hilljaycie14 A work around solution is to set the IgnoreMissingFeatureFilters option as true.
services.Configure<FeatureManagementOptions>(options => options.IgnoreMissingFeatureFilters = true);
I am working on a PR to resolve this issue and make the behavior consistent with 2.6.1.
Sorry for the inconvenience.

from featuremanagement-dotnet.

zhiyuanliang-ms avatar zhiyuanliang-ms commented on June 9, 2024

I checked the behavior in 2.6.1.

Let's say you have a non-contextual filter called FilterA and a contextual filters FilterB which accepts TypeT.
You also have a feature flag "MyFeature" which references FilterA and FilterB.
Assume that IgnoreMissingFeatureFilter is false.

When you call IsEnabledAsync("MyFeature")
In 2.6.1:
The metadata of FilterA and FilterB can be found by the feature manager. No exception will be thrown.
The context is not provided, feature manager will just ignore the FilterB.
In 3.0.0:
The metadata of FilterB cannot be found by the feature manager. In 3.0.0, context type and filter alias are both needed to get the metadata of a contextual filter. An exception will be thrown.

When you call IsEnabledAsync("MyFeature", context), if context's type is TypeT
The behaviors are the same.

When you call IsEnabledAsync("MyFeature", context), if context's type is TypeF
In 2.6.1:
The metadata of FilterA and FilterB can be found by the feature manager. No exception will be thrown.
The context type TypeF cannot be consumed by FilterB, feature manager will not find a ContextualFeatureFilterEvaluator for FilterB. The evaluation of FilterB will be skipped.
In 3.0.0:
The metadata of FilterB cannot be found by the feature manager. In 3.0.0, context type and filter alias are both needed to get the metadata of a contextual filter. An exception will be thrown.

from featuremanagement-dotnet.

MoazAlkharfan avatar MoazAlkharfan commented on June 9, 2024

Breaking change was not reported for the following scenario
With the below configuration, when using IFeatureManager.IsEnabledAsync("FeatureToCheck")
throws an exception for the ContextualFilter instead of skipping the ContextualFilter. but when using IFeatureManager.IsEnabledAsync("FeatureToCheck", context) works fine.

"FeatureManagement": {
    "FeatureToCheck": {
        "RequirementType": "Any",
        "EnabledFor": [
            {
                "Name": "ContextualFilter"
            },
            {
                "Name": "NonContextualFilter"
            }
        ]
    }
}

from featuremanagement-dotnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.