Repository navigation
feat: add per-call sendFeatureFlagEvent to getFeatureFlag and isFeatureEnabled - #666
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
PostHog Review · Standard · reviewed 45e6615: 1 Should fix.
See this review and its findings in PostHog Review. Comment @posthog review --deep for a Deep review. A Deep review takes longer and looks deeper than a Standard review.
Contributor
posthog-flutter Compliance ReportDate: 2026-10-26 17:59:48 UTC ✅ All Tests Passed!45/45 tests passed Capture Tests✅ 29/29 tests passed View Details
Feature_Flags Tests✅ 16/16 tests passed View Details
|
ioannisj
approved these changes
Oct 26, 2026
turnipdabeets
enabled auto-merge (squash)
October 26, 2026 17:50
turnipdabeets
force-pushed
the
feat/flutter-flag-send-event-override
branch
from
October 26, 2026 17:54
451c373 to
a6213ab
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
💡 Motivation and Context
Adds an optional
bool? sendFeatureFlagEventtoPosthog().getFeatureFlag(key)andPosthog().isFeatureEnabled(key), matching posthog-iosgetFeatureFlag(_:sendFeatureFlagEvent:)/isFeatureEnabled(_:sendFeatureFlagEvent:)and posthog-androidgetFeatureFlag(key, sendFeatureFlagEvent: Boolean?)/isFeatureEnabled(key, sendFeatureFlagEvent: Boolean?).null(default): followsPostHogConfig.sendFeatureFlagEvent, so existing calls behave exactly as before.true/false: overrides the config for that call.No
defaultValueparameter, since iOS has none. The per-platform handling ofnullmirrors #662 (which does the same forgetFeatureFlagResulton the 6.0 branch):nulltrue/falsegetFeatureFlag(_:sendFeatureFlagEvent:)/isFeatureEnabled(_:sendFeatureFlagEvent:)(posthog-ios 3.37.0+, floor is 3.72.0)nullsend_event{send_event: <value>}to posthog-jsgetFeatureFlag/isFeatureEnabledNo native version floor bumps needed. The method-channel argument is named
sendEvent, same asgetFeatureFlagResultuses.getFeatureFlagResultkeeps its existingsendEventparameter onmain; the 6.0 branch already renames it tosendFeatureFlagEvent(#647), so the new parameter uses the 6.0 name from the start.💚 How did you test it?
falseskips$feature_flag_calledfor both methods; config off +nullskips it,truecaptures it), method-channel arguments fornull/true/false, web handler mapping to posthog-js options, andPosthogforwarding.flutter analyze,flutter test,dart format --set-exit-if-changed lib test,scripts/check-api-dart.sh(snapshot updated), ktlint and swiftformat lint all pass.flutter build apk --debugandflutter build ios --simulator --debuginexample/succeed.flutter test --platform chromeon the web handler tests: the new tests pass. Threeapp versiontests fail locally onmaintoo (they rely on Flutter 3.47+ build defines; local Flutter is 3.44.1).📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Claude Code implemented this as the second of four feature-flag parity PRs. Native signatures were checked against posthog-ios and posthog-android
main, and the posthog-jsFeatureFlagOptions.send_eventoption. Note for reviewers: adding an optional named parameter toPosthogFlutterPlatformInterface.getFeatureFlag/isFeatureEnabledmeans any third-party subclass that overrides them must add the parameter. Commits are signed.🤖 Generated with Claude Code