-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CustomFilter breaks when upgrading to 2.6.0 with null reference exception #244
Comments
Thank you for finding this and the detailed explanation @timvandenhof , This issue spawned from an incorrect assumption in the caching changes that the context passed by the FeatureManager would be used by all filters. In your case, it's not used by the filter within. I have a pull request out now that should solve the issue #246 |
That is a very quick fix., thank you! |
Hey @timvandenhof, I just pushed 2.6.1 to nuget. Could you try with that package and confirm your issue is fixed? |
At teammember performed the update from 2.5.1 to 2.6.1 last monday, so far it seems to work fine! |
@timvandenhof great to hear. Thanks for reporting this early for us to address. Closing the issue. |
Affected version: 2.6.0
Non-affected version: 2.5.1
Description
When we upgraded Microsoft.FeatureManagement.AspNetCore from 2.5.0 to 2.6.0, we noticed a runtime null reference exception. The null reference exception occurs inside
TryValidateSettings
of theContextualTargettingFilter
class.This seems to be caused by
context.settings
beingnull
.Stacktrace via Application Insights
Cause investigation
Findings so far:
EvaluateAsync
an exception is thrown.context.settings
parameter we are passing in isnull
.FeatureFilterEvaluationContext
, and are allowed to be null:new TargetingFilterSettings
is executed internally in theContextualTargettingFilter
.ContextualTargettingFilter
,TryValidateSettings
does validate ifsettings.Audience
is not null, so we known that the Audience object itself is not the one being null.exclusions.users
is not properly checked, caused by this update: 1fedf2c#diff-ce034ec15b166c3225dd701696c952c080492837f06f986b22aabbd2390fe242Null checking in TryValidateSettings is insufficient?
Workaround
Downgrading from 2.6.0 to 2.5.1 seems to resolve the issue.
Potential solutions
The text was updated successfully, but these errors were encountered: