You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow different type of filters to share the same Alias (#262)
* allow dup alias & target on main branch
* fix bug: non-contextual filter will not be found when there is context
* keep using ContextualFeatureFilterEvaluator.IsContextualFilter
* fix bug
* use typeof & avoid using repeated code
* resolve comments & add testcase
* resolve comments
* remove unnecessary '?'
* use var
// Feature filters can have namespaces in their alias
291
-
// If a feature is configured to use a filter without a namespace such as 'MyFilter', then it can match 'MyOrg.MyProduct.MyFilter' or simply 'MyFilter'
292
-
// If a feature is configured to use a filter with a namespace such as 'MyOrg.MyProduct.MyFilter' then it can only match 'MyOrg.MyProduct.MyFilter'
293
-
if(filterName.Contains('.'))
294
+
if(appContextType==null)
294
295
{
295
-
//
296
-
// The configured filter name is namespaced. It must be an exact match.
thrownewFeatureManagementException(FeatureManagementError.AmbiguousFeatureFilter,$"Multiple feature filters match the configured filter named '{filterName}'.");
304
+
if(appContextType==null)
305
+
{
306
+
thrownewFeatureManagementException(FeatureManagementError.AmbiguousFeatureFilter,$"Multiple feature filters match the configured filter named '{filterName}'.");
307
+
}
308
+
else
309
+
{
310
+
thrownewFeatureManagementException(FeatureManagementError.AmbiguousFeatureFilter,$"Multiple contextual feature filters match the configured filter named '{filterName}' and context type '{appContextType}'.");
// Feature filters can have namespaces in their alias
334
+
// If a feature is configured to use a filter without a namespace such as 'MyFilter', then it can match 'MyOrg.MyProduct.MyFilter' or simply 'MyFilter'
335
+
// If a feature is configured to use a filter with a namespace such as 'MyOrg.MyProduct.MyFilter' then it can only match 'MyOrg.MyProduct.MyFilter'
336
+
if(filterName.Contains('.'))
337
+
{
338
+
//
339
+
// The configured filter name is namespaced. It must be an exact match.
Assert.Equal($"Multiple contextual feature filters match the configured filter named '{duplicatedFilterName}' and context type '{typeof(DummyContext)}'.",ex.Message);
0 commit comments