Skip to content

Commit b3caf8d

Browse files
authored
feat: enable per-context summary events (#288)
## Overview Enables **per-context summary events** in the .NET client-side SDK, now that the supporting InternalSdk change has been released. - `EventProcessorBuilder.cs`: sets `PerContextSummaries = true` on the events configuration. - `TestService.cs` (contract tests): advertises the `client-per-context-summaries` capability so the harness runs the per-context summary variants. - `LaunchDarkly.ClientSdk.csproj`: bumps `LaunchDarkly.InternalSdk` 3.6.1 → **3.7.0** (the published version that adds per-context summary support — `EventsConfiguration.PerContextSummaries`). This is the dependency bump the original commit deferred until the InternalSdk release. ## Validation (against the published 3.7.0 package, not a local build) - Builds clean against `LaunchDarkly.InternalSdk` 3.7.0 restored from NuGet. - Contract tests (sdk-test-harness **v2** / 2.37.0) pass fully: - `events` suite: 353 ran, **0 failures** — including the per-context summary variants `basic counter behavior for per context summaries` and `context kinds for per context summaries` (gated on the `client-per-context-summaries` capability). - Full suite: **922 total, 14 skipped, 908 ran, 0 failures**. Relates to SDK-2450. Depends on dotnet-sdk-internal SDK-2449 (released as InternalSdk 3.7.0). Left as a draft for review. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes analytics event shape and delivery semantics for all client-side SDK users; dependency bump ties behavior to InternalSdk 3.7.0 event processing. > > **Overview** > Turns on **per-context analytics summary events** for the .NET client-side SDK by setting `PerContextSummaries = true` in `EventProcessorBuilder`’s `EventsConfiguration`, so summaries are emitted per active context (with context attached) instead of the prior aggregation behavior. > > Contract test harness capability **`client-per-context-summaries`** is advertised so v2 harness runs the per-context summary scenarios. **`LaunchDarkly.InternalSdk`** is bumped **3.6.1 → 3.7.0**, which supplies `EventsConfiguration.PerContextSummaries`. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit bbd03b8. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 485976e commit b3caf8d

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

pkgs/sdk/client/contract-tests/TestService.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ public class Webapp
4141
"auto-env-attributes",
4242
"inline-context-all",
4343
"anonymous-redaction",
44-
"client-prereq-events"
44+
"client-prereq-events",
45+
"client-per-context-summaries"
4546
};
4647

4748
public readonly Handler Handler;

pkgs/sdk/client/src/Integrations/EventProcessorBuilder.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,10 @@ private EventsConfiguration MakeEventsConfiguration(LdClientContext context, boo
228228
DiagnosticRecordingInterval = _diagnosticRecordingInterval,
229229
DiagnosticUri = baseUri.AddPath(StandardEndpoints.DiagnosticEventsPostRequestPath),
230230
PrivateAttributes = _privateAttributes.ToImmutableHashSet(),
231-
RetryInterval = TimeSpan.FromSeconds(1)
231+
RetryInterval = TimeSpan.FromSeconds(1),
232+
// Client-side SDKs emit a summary event per context, with the context attached,
233+
// since only one context is active at a time and context cardinality is low.
234+
PerContextSummaries = true
232235
};
233236
}
234237
}

pkgs/sdk/client/src/LaunchDarkly.ClientSdk.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0"/>
5252
<PackageReference Include="LaunchDarkly.CommonSdk" Version="7.2.0"/>
5353
<PackageReference Include="LaunchDarkly.EventSource" Version="5.2.1"/>
54-
<PackageReference Include="LaunchDarkly.InternalSdk" Version="3.6.1" />
54+
<PackageReference Include="LaunchDarkly.InternalSdk" Version="3.7.0" />
5555
<PackageReference Include="LaunchDarkly.Logging" Version="2.0.0"/>
5656
<PackageReference Include="Microsoft.Maui.Essentials" Version="8.0.100" />
5757
<Compile Include="**\*.cs" Exclude="PlatformSpecific\*.cs;bin\**\*.cs;obj\**\*.cs"/>

0 commit comments

Comments
 (0)