feat: Allow not sending evaluation event when evaluating a flag #390
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Requirements
Describe the solution you've provided
We'd like to be able to evaluate a flag without sending an evaluation event to LaunchDarkly. This is useful, for example, for internal tooling that helps debug issues by listing the value of a flag for a particular context. We don't want to send an evaluation event to LD because it doesn't constitute a "real" evaluation so we don't want to consider it as evidence that a flag is still being evaluated and shouldn't be cleaned up.
Describe alternatives you've considered
all_flags_state, but that's a much more expensive operation, and doesn't allow us to pass custom contexts on a per-flag basisNote
Adds a per-call
send_eventsflag tovariation/variation_detailto evaluate without emitting events, with internal wiring and a test.send_eventsoptional parameter (defaultTrue) toLDClient.variationandLDClient.variation_detailto allow evaluating flags without emitting analytics events.send_eventsthrough_evaluate_internal, gating all event emissions (new_unknown_flag_event, evaluation result events, and default events).test_no_event_when_send_events_falseverifying no events are produced whensend_events=False.Written by Cursor Bugbot for commit c9d92a7. This will update automatically on new commits. Configure here.