Skip to content

Commit 2e70072

Browse files
feat: Add Track method to IFeatureClient (#519)
<!-- Please use this template for your pull request. --> <!-- Please use the sections that you need and delete other sections --> ## This PR <!-- add the description of the PR here --> Adds Track method to `IFeatureClient` so developers dependent on this abstraction can track user interactions. ### Related Issues <!-- add here the GitHub issue that this PR resolves if applicable --> Fixes #518 ### Notes <!-- any additional notes for this PR --> ### Follow-up Tasks <!-- anything that is related to this PR but not done here should be noted under this section --> <!-- if there is a need for a new issue, please link it here --> ### How to test <!-- if applicable, add testing instructions under this section --> Signed-off-by: Kyle Julian <[email protected]>
1 parent f6ae8dd commit 2e70072

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

src/OpenFeature/IFeatureClient.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ public interface IFeatureClient : IEventBus
5555
/// Returns the current status of the associated provider.
5656
/// </summary>
5757
/// <returns><see cref="ProviderStatus"/></returns>
58-
ProviderStatus ProviderStatus { get; }
59-
58+
ProviderStatus ProviderStatus { get; }
59+
6060
/// <summary>
6161
/// Resolves a boolean feature flag
6262
/// </summary>
@@ -166,4 +166,13 @@ public interface IFeatureClient : IEventBus
166166
/// <param name="cancellationToken">The <see cref="CancellationToken"/>.</param>
167167
/// <returns>Resolved flag details <see cref="FlagEvaluationDetails{T}"/></returns>
168168
Task<FlagEvaluationDetails<Value>> GetObjectDetailsAsync(string flagKey, Value defaultValue, EvaluationContext? context = null, FlagEvaluationOptions? config = null, CancellationToken cancellationToken = default);
169+
170+
/// <summary>
171+
/// Use this method to track user interactions and the application state.
172+
/// </summary>
173+
/// <param name="trackingEventName">The name associated with this tracking event</param>
174+
/// <param name="evaluationContext">The evaluation context used in the evaluation of the flag (optional)</param>
175+
/// <param name="trackingEventDetails">Data pertinent to the tracking event (Optional)</param>
176+
/// <exception cref="ArgumentException">When trackingEventName is null or empty</exception>
177+
void Track(string trackingEventName, EvaluationContext? evaluationContext = default, TrackingEventDetails? trackingEventDetails = default);
169178
}

src/OpenFeature/OpenFeatureClient.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -302,13 +302,7 @@ await hookRunner.TriggerFinallyHooksAsync(evaluation, options?.HookHints, cancel
302302
return evaluation;
303303
}
304304

305-
/// <summary>
306-
/// Use this method to track user interactions and the application state.
307-
/// </summary>
308-
/// <param name="trackingEventName">The name associated with this tracking event</param>
309-
/// <param name="evaluationContext">The evaluation context used in the evaluation of the flag (optional)</param>
310-
/// <param name="trackingEventDetails">Data pertinent to the tracking event (Optional)</param>
311-
/// <exception cref="ArgumentException">When trackingEventName is null or empty</exception>
305+
/// <inheritdoc />
312306
public void Track(string trackingEventName, EvaluationContext? evaluationContext = default, TrackingEventDetails? trackingEventDetails = default)
313307
{
314308
if (string.IsNullOrWhiteSpace(trackingEventName))

0 commit comments

Comments
 (0)