feat: Keep override-affected evaluations out of individual events - #2052
kinyoklion wants to merge 1 commit into
Conversation
9bc7846 to
0c00688
Compare
f2a06ab to
bab7cc6
Compare
0c00688 to
e42e2cb
Compare
bab7cc6 to
c224cd1
Compare
e42e2cb to
8e9fd05
Compare
c224cd1 to
ed51797
Compare
|
@launchdarkly/js-sdk-common size report |
|
@launchdarkly/js-client-sdk size report |
|
@launchdarkly/js-client-sdk-common size report |
8e9fd05 to
71a1426
Compare
ed51797 to
1f0e0c9
Compare
71a1426 to
a9e83b1
Compare
1f0e0c9 to
ee3c511
Compare
a9e83b1 to
a5614f5
Compare
ee3c511 to
e4656e8
Compare
a5614f5 to
d0ed461
Compare
e4656e8 to
cd8301d
Compare
d0ed461 to
667c330
Compare
cd8301d to
f8bd9a5
Compare
667c330 to
431c72b
Compare
f8bd9a5 to
3a6273a
Compare
431c72b to
980675a
Compare
3a6273a to
5095497
Compare
980675a to
d3694fb
Compare
5095497 to
7fdfeaf
Compare
d3694fb to
d1d703d
Compare
1fe976f to
764637d
Compare
557ef18 to
4fc2262
Compare
764637d to
21504bf
Compare
|
bugbot review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 21504bf. Configure here.
Adds the analytics event behavior of the OVERRIDE specification. An evaluation marked as override-affected produces no individual feature event and no debug event, even when the flag requests them. It is counted in summary events like any other evaluation, in a separate counter that carries the overrideAffected marker. The marker is part of the summary aggregation key, so override-affected and other evaluations of the same flag, variation, and version accumulate into separate counters. The marker is present on a counter only when true, like the unknown marker. The client hands the marking to the event processor as a scalar on the input event, taken from the evaluation result. Event generation does not read the reason. The record of a prerequisite evaluation carries the prerequisite's own marking, so an unaffected prerequisite inside a marked evaluation still produces its individual event. The OVERRIDE test vector runner now also asserts the marking of the summary counter that each evaluation contributes to.
21504bf to
41a072c
Compare
Summary
This PR is based on the override store branch because it consumes the override marking that branch produces on evaluation results.
This change adds the analytics event behavior of the OVERRIDE specification to the shared event code and the Node.js server SDK.
An evaluation marked as override-affected produces no individual feature event and no debug event, even when the flag requests them. It is still counted in summary events like any other evaluation, in a separate counter that carries the
overrideAffectedmarker. The marker is part of the summary aggregation key, so override-affected and other evaluations of the same flag, variation, and version accumulate into separate counters rather than collapsing together. The marker is present on a counter only when true, like the existingunknownmarker.The client hands the marking to the event processor as a scalar on the input event, taken from the evaluation result. Event generation does not read the evaluation reason. The record of a prerequisite evaluation carries the prerequisite's own marking, so an unaffected prerequisite inside a marked top-level evaluation still produces its individual event, while a marked prerequisite record produces none and is counted under the marked counter for the prerequisite flag.
The shared event summarizer and processor are also used by the client-side SDKs. The new field is optional and those SDKs never set it, so their output is unchanged.
The OVERRIDE test vector runner now also asserts the marking of the summary counter that each evaluation contributes to, by flushing the events and reading the summary payload.
SDK-3247
Note
Overview
Implements OVERRIDE-spec analytics for evaluations touched by the override store: the server SDK passes an
overrideAffectedflag from the evaluation result into event creation (not from the reason), including per-prerequisite records with each prereq’s own marking.Override-affected evaluations are still included in summary events but are excluded from individual feature and debug events even when
trackEvents/ debug mode would normally emit them. The summarizer treatsoverrideAffectedas part of the aggregation key, so marked and unmarked evaluations of the same flag/variation/version land in separate counters; the summary payload setsoverrideAffected: trueonly on marked counters.Shared
EventFactoryBase/InputEvalEventplumbing carries the optional field (client SDKs never set it, so behavior there is unchanged). Tests cover the shared processor/summarizer, end-to-end server override scenarios (including prereq trees), and OVERRIDE vectors assertingsummaryOverrideAffectedafter flush.Reviewed by Cursor Bugbot for commit 21504bf. Bugbot is set up for automated code reviews on this repo. Configure here.