fix: Respect send_feature_flags setting and deprecate send_feature_flag_events in get_feature_flag_payload
#391
+106
−67
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.
Summary
capture()to respectsend_feature_flags=Falsewhen local evaluation is enabledsend_feature_flag_eventsparameter inget_feature_flag_payload()and default it toFalseProblem
When local evaluation was enabled (
personal_api_keyset and flags loaded),capture()automatically attached all locally-evaluated feature flags to events, ignoring thesend_feature_flagsparameter entirely.get_feature_flag_payload()was sending$feature_flag_calledevents by default, which is unexpected by current SDK standards.Solution
Removed the automatic flag evaluation block in
capture()that ran unconditionally whenself.feature_flagswas populated. Flags are now only attached whensend_feature_flags=Trueis explicitly passed.Changed
send_feature_flag_eventsdefault toFalseinget_feature_flag_payload()and added a deprecation warning directing users to useget_feature_flag()if they need events, and remove the deprecated option.Related to PostHog/posthog#31425