Skip to content

feat: Keep override-affected evaluations out of individual events - #2052

Draft
kinyoklion wants to merge 1 commit into
rlamb/overrides-node-override-layerfrom
rlamb/overrides-node-events
Draft

kinyoklion wants to merge 1 commit into
rlamb/overrides-node-override-layerfrom
rlamb/overrides-node-events

Conversation

@kinyoklion

@kinyoklion kinyoklion commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

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 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 rather than collapsing together. The marker is present on a counter only when true, like the existing 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 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 overrideAffected flag 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 treats overrideAffected as part of the aggregation key, so marked and unmarked evaluations of the same flag/variation/version land in separate counters; the summary payload sets overrideAffected: true only on marked counters.

Shared EventFactoryBase / InputEvalEvent plumbing 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 asserting summaryOverrideAffected after flush.

Reviewed by Cursor Bugbot for commit 21504bf. Bugbot is set up for automated code reviews on this repo. Configure here.

@kinyoklion
kinyoklion force-pushed the rlamb/overrides-node-override-layer branch from 9bc7846 to 0c00688 Compare September 28, 2026 20:28
@kinyoklion
kinyoklion force-pushed the rlamb/overrides-node-events branch from f2a06ab to bab7cc6 Compare September 28, 2026 20:28
@kinyoklion
kinyoklion force-pushed the rlamb/overrides-node-override-layer branch from 0c00688 to e42e2cb Compare September 28, 2026 21:20
@kinyoklion
kinyoklion force-pushed the rlamb/overrides-node-events branch from bab7cc6 to c224cd1 Compare September 28, 2026 21:20
@kinyoklion
kinyoklion force-pushed the rlamb/overrides-node-override-layer branch from e42e2cb to 8e9fd05 Compare September 29, 2026 15:20
@kinyoklion
kinyoklion force-pushed the rlamb/overrides-node-events branch from c224cd1 to ed51797 Compare September 29, 2026 15:20
@kinyoklion
kinyoklion added this pull request to stack #2061 September 30, 2026 17:08
@github-actions

Copy link
Copy Markdown
Contributor

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 27281 bytes
Compressed size limit: 29000
Uncompressed size: 132642 bytes

@github-actions

Copy link
Copy Markdown
Contributor

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Compressed size: 32691 bytes
Compressed size limit: 34000
Uncompressed size: 117095 bytes

@github-actions

Copy link
Copy Markdown
Contributor

@launchdarkly/js-client-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 25437 bytes
Compressed size limit: 44000
Uncompressed size: 165420 bytes

@kinyoklion
kinyoklion force-pushed the rlamb/overrides-node-override-layer branch from 8e9fd05 to 71a1426 Compare September 30, 2026 18:17
@kinyoklion
kinyoklion force-pushed the rlamb/overrides-node-events branch from ed51797 to 1f0e0c9 Compare September 30, 2026 18:17
@kinyoklion
kinyoklion removed this pull request from stack #2061 September 30, 2026 18:37
@kinyoklion
kinyoklion force-pushed the rlamb/overrides-node-override-layer branch from 71a1426 to a9e83b1 Compare September 30, 2026 20:16
@kinyoklion
kinyoklion force-pushed the rlamb/overrides-node-events branch from 1f0e0c9 to ee3c511 Compare September 30, 2026 20:16
@kinyoklion
kinyoklion force-pushed the rlamb/overrides-node-override-layer branch from a9e83b1 to a5614f5 Compare September 30, 2026 20:23
@kinyoklion
kinyoklion force-pushed the rlamb/overrides-node-events branch from ee3c511 to e4656e8 Compare September 30, 2026 20:23
@kinyoklion
kinyoklion force-pushed the rlamb/overrides-node-override-layer branch from a5614f5 to d0ed461 Compare September 30, 2026 21:01
@kinyoklion
kinyoklion force-pushed the rlamb/overrides-node-events branch from e4656e8 to cd8301d Compare September 30, 2026 21:01
@kinyoklion
kinyoklion force-pushed the rlamb/overrides-node-override-layer branch from d0ed461 to 667c330 Compare September 30, 2026 21:04
@kinyoklion
kinyoklion force-pushed the rlamb/overrides-node-events branch from cd8301d to f8bd9a5 Compare September 30, 2026 21:04
@kinyoklion
kinyoklion force-pushed the rlamb/overrides-node-override-layer branch from 667c330 to 431c72b Compare September 30, 2026 22:23
@kinyoklion
kinyoklion force-pushed the rlamb/overrides-node-events branch from f8bd9a5 to 3a6273a Compare September 30, 2026 22:23
@kinyoklion
kinyoklion force-pushed the rlamb/overrides-node-override-layer branch from 431c72b to 980675a Compare September 30, 2026 22:27
@kinyoklion
kinyoklion force-pushed the rlamb/overrides-node-events branch from 3a6273a to 5095497 Compare September 30, 2026 22:27
@kinyoklion
kinyoklion force-pushed the rlamb/overrides-node-override-layer branch from 980675a to d3694fb Compare October 1, 2026 23:07
@kinyoklion
kinyoklion force-pushed the rlamb/overrides-node-events branch from 5095497 to 7fdfeaf Compare October 1, 2026 23:07
@kinyoklion
kinyoklion force-pushed the rlamb/overrides-node-override-layer branch from d3694fb to d1d703d Compare October 1, 2026 23:52
@kinyoklion
kinyoklion force-pushed the rlamb/overrides-node-events branch 2 times, most recently from 1fe976f to 764637d Compare October 2, 2026 16:08
@kinyoklion
kinyoklion force-pushed the rlamb/overrides-node-override-layer branch from 557ef18 to 4fc2262 Compare October 3, 2026 00:40
@kinyoklion
kinyoklion force-pushed the rlamb/overrides-node-events branch from 764637d to 21504bf Compare October 3, 2026 00:40
@kinyoklion

Copy link
Copy Markdown
Member Author

bugbot review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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.
@kinyoklion
kinyoklion force-pushed the rlamb/overrides-node-events branch from 21504bf to 41a072c Compare October 3, 2026 01:45

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant