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
feat(flags): minimize $feature_flag_called events for non-experiment flags (#263)
* feat(flags): send minimal $feature_flag_called events when server-gated
Emit a minimal $feature_flag_called event when the server enables the
gate (minimalFlagCalledEvents in the /flags v2 response, or
minimal_flag_called_events in the local evaluation payload) and the
evaluated flag reports has_experiment == false. Minimal events keep a
strict allowlist of flag evaluation properties and strip everything
else, including the $feature/<key> enumeration and super properties.
Any missing signal (gate absent, has_experiment unknown, legacy
response shapes) sends the full event, exactly as before.
Generated-By: PostHog Code
Task-Id: ffe402fd-d75c-4043-8e5d-d2fe513cac6f
* Extract shared minimal-event gate predicate and add coverage
Extract ShouldSendMinimalFeatureFlagCalledEvent(gate, hasExperiment) to
remove the duplicated inline rule at both call sites. Add coverage for the
snapshot path's fallback to the full event when has_experiment is unknown,
and for $feature_flag_error surviving the minimal-event allowlist.
Send minimal `$feature_flag_called` events when the server enables it (`minimalFlagCalledEvents` in the `/flags` v2 response or `minimal_flag_called_events` in the local evaluation payload) and the evaluated flag is not linked to an experiment. Minimal events keep a strict allowlist of flag evaluation properties and strip everything else, including the `$feature/<key>` enumeration and super properties. Experiment-linked flags and responses that do not carry the field continue to send the full event.
0 commit comments