Repository navigation
feat!: remove PostHogConfig.onFeatureFlags in favor of the listener - #918
Merged
turnipdabeets merged 5 commits intoNov 2, 2026
Merged
turnipdabeets merged 5 commits into
turnipdabeets merged 5 commits into
Conversation
The canonical client signature has no default and iOS, Flutter and RN have none. A fallback was also reported as the flag value in $feature_flag_called. A disabled SDK now returns null; isFeatureEnabled keeps its defaultValue.
The onFeatureFlags() listener can be registered before setup(), gets bootstrapped flags, and is removable, so the config field no longer adds anything. iOS and posthog-js only have the listener form.
This was referenced Oct 30, 2026
Merged
… HEAD # Conflicts: # .changeset/android-v4-major.md
…default' into HEAD # Conflicts: # .changeset/android-v4-major.md
marandaneto
approved these changes
Nov 2, 2026
marandaneto
left a comment
Member
There was a problem hiding this comment.
The code looks good; no qualifying findings. Verdict: correct.
Base automatically changed from
feat/v4-remove-get-feature-flag-default
to
chore/v4-remove-deprecated
November 2, 2026 15:08
8 of 20 tasks
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
Stacked on #917. Makes
PostHog.onFeatureFlags(callback)the only flag-load listener, matching posthog-ios 4.0 and posthog-js. The listener already does what the config field did: it can be registered beforesetup(), gets bootstrapped flags, and can also be removed.Breaking: removes
PostHogConfig.onFeatureFlags. Migration: callPostHog.onFeatureFlags { ... }beforesetup().reloadFeatureFlags(callback)stays.Behavior differences for anyone migrating:
setup()is called, not synchronously inside it.errorsLoading=true;reloadFeatureFlags(callback)still gets that.posthog-serverkeeps its ownonFeatureFlagsconfig, which is a separate callback.💚 How did you test it?
:posthog:test,:posthog-android:testReleaseUnitTest,:posthog-server:test,:posthog-server-openfeature:test,:posthog-android-surveys-compose:testDebugUnitTest, samples compile,apiCheck,spotlessCheck.setup()fails the close-from-an-integration test.Ran through the Flutter example with local posthog-android and posthog-ios against a local mock server (Android emulator API 37, iOS 26.4 simulator). Temporary overrides lived in a throwaway worktree.
setup()gets the first load (cold start){known-on, checkout},errorsLoading=false{boot-flag, boot-variant}, then the/flagsvalues/flags500 on relauncherrorsLoading=true📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
🤖 Generated with Claude Code