-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Labels
area: dependency-injectionImprovements or bugs do DIImprovements or bugs do DIgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededtype: bugSomething isn't workingSomething isn't working
Description
Observed behavior
Calling OpenFeatureBuilder.AddContext()
after you have added any providers causes the EvaluationContext
to not be injected into the Api instance.
Expected Behavior
Calling OpenFeatureBuilder.AddContext()
any place on the builder should add the EvaluationContext
to the Api.
Steps to reproduce
Example code:
builder.Services.AddOpenFeature(featureBuilder =>
{
featureBuilder
.AddHostedFeatureLifecycle()
.AddInMemoryProvider("InMemory", _ => new Dictionary<string, Flag>()
{
{
"welcome-message", new Flag<bool>(
new Dictionary<string, bool> { { "show", true }, { "hide", false } }, "show")
}
})
.AddContext(ctx => ctx.Set("region", "euw"));
});
Recording of the bug in action using a LoggingHook to read out the injected EvaluationContext
.
no-evaluation-context-added.mp4
Metadata
Metadata
Assignees
Labels
area: dependency-injectionImprovements or bugs do DIImprovements or bugs do DIgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededtype: bugSomething isn't workingSomething isn't working