Skip to content

Commit

Permalink
Fix breaking change.
Browse files Browse the repository at this point in the history
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
  • Loading branch information
askpt committed Jan 7, 2025
1 parent 1a0c16d commit 41c915d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/OpenFeature/Hooks/MetricsHook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ public override ValueTask ErrorAsync<T>(HookContext<T> context, Exception error,
}

/// <inheritdoc/>
public override ValueTask FinallyAsync<T>(HookContext<T> context, IReadOnlyDictionary<string, object>? hints = null, CancellationToken cancellationToken = default)
public override ValueTask FinallyAsync<T>(HookContext<T> context,
FlagEvaluationDetails<T> evaluationDetails,
IReadOnlyDictionary<string, object>? hints = null,
CancellationToken cancellationToken = default)
{
var tagList = new TagList
{
Expand All @@ -95,6 +98,6 @@ public override ValueTask FinallyAsync<T>(HookContext<T> context, IReadOnlyDicti

this._evaluationActiveUpDownCounter.Add(-1, tagList);

return base.FinallyAsync(context, hints, cancellationToken);
return base.FinallyAsync(context, evaluationDetails, hints, cancellationToken);
}
}
3 changes: 2 additions & 1 deletion test/OpenFeature.Tests/Hooks/MetricsHookTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,10 @@ public async Task Finally_Test()
var evaluationContext = EvaluationContext.Empty;
var ctx = new HookContext<string>("my-flag", "foo", Constant.FlagValueType.String,
new ClientMetadata("my-client", "1.0"), new Metadata("my-provider"), evaluationContext);
var evaluationDetails = new FlagEvaluationDetails<string>("my-flag", "foo", Constant.ErrorType.None, "STATIC", "default");

// Act
await metricsHook.FinallyAsync(ctx, new Dictionary<string, object>()).ConfigureAwait(true);
await metricsHook.FinallyAsync(ctx, evaluationDetails, new Dictionary<string, object>()).ConfigureAwait(true);
this._meterProvider.ForceFlush();

// Assert metrics
Expand Down

0 comments on commit 41c915d

Please sign in to comment.