You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9dcbf77
Browse filesBrowse the repository at this point in the historyBrowse files
feat: Count override-affected evaluations separately and send no individual events for them (#219)
## Summary
The OVERRIDE specification marks an evaluation as override-affected when
any definition it read came from the SDK's override store. Such an
evaluation appears in summary events only: it produces no individual
feature event and no debug event, whatever the flag's configuration
requests, and it is counted in a separate summary counter that carries
an `overrideAffected` marker, so override-affected and ordinary
evaluations of the same flag, variation, and version are never collapsed
together.
- `Event.FeatureRequest` carries the marking as a boolean that the SDK
sets from its evaluation result. The existing constructors keep working
and leave it false; `toDebugEvent()` keeps the value.
- `DefaultEventProcessor` keys individual feature event and debug event
emission on the marking. Index events and summaries are unchanged.
- `EventSummarizer` keeps a second set of counters per flag for marked
evaluations, created on first use so unmarked flags pay nothing.
`EventOutputFormatter` writes `overrideAffected: true` only on those
counters, the same way the `unknown` marker is written.
- `EventSummarizerInterface` gains the marker parameter and keeps the
previous signature as a default method that delegates with false.
Flag overrides are currently experimental and subject to change. The
server SDK change that sets the marking depends on the release of this
package.
[SDK-3246](https://launchdarkly.atlassian.net/browse/SDK-3246)
[SDK-3246]:
https://launchdarkly.atlassian.net/browse/SDK-3246?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Overview**
> Adds **override-affected** handling for flag evaluations tied to the
experimental override store: `Event.FeatureRequest` carries an
`overrideAffected` flag (existing constructors default to false).
>
> **`DefaultEventProcessor`** still summarizes and emits index events,
but **suppresses individual feature and debug events** whenever
`isOverrideAffected()` is true, regardless of `trackEvents` or debug
configuration.
>
> **`EventSummarizer`** (and aggregated/per-context wrappers) buckets
those evaluations in a **separate counter map** per flag so they are not
merged with normal counts for the same version/variation;
**`EventOutputFormatter`** emits `overrideAffected: true` only on those
summary counters.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
0e7744f. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
0 commit comments