Repository navigation
chore!: remove the didReceiveFeatureFlags notification - #965
Merged
turnipdabeets merged 3 commits intoOct 27, 2026
Merged
turnipdabeets merged 3 commits into
turnipdabeets merged 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
PostHog Review · Standard · reviewed dcd51a5: 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.
turnipdabeets
force-pushed
the
chore/v4-remove-deprecated
branch
from
October 23, 2026 17:13
0274681 to
ce9e3ac
Compare
turnipdabeets
force-pushed
the
chore/v4-remove-did-receive-feature-flags
branch
from
October 23, 2026 17:20
4258589 to
2f19c61
Compare
Contributor
posthog-ios Compliance ReportDate: 2026-10-27T17:44:09.301543+00:00
|
| Test | Status | Duration |
|---|---|---|
| Format Validation.Event Has Required Fields | ✅ | 3106ms |
| Format Validation.Event Has Uuid | ✅ | 2799ms |
| Format Validation.Event Has Lib Properties | ✅ | 2875ms |
| Format Validation.Distinct Id Is String | ✅ | 2732ms |
| Format Validation.Token Is Present | ✅ | 2761ms |
| Format Validation.Custom Properties Preserved | ✅ | 462ms |
| Format Validation.Event Has Timestamp | ✅ | 2838ms |
| Format Validation.Non Utc Event Timestamp Is Converted To Utc | ✅ | 2822ms |
| Retry Behavior.Retries On 503 | ✅ | 11736ms |
| Retry Behavior.Does Not Retry On 400 | ✅ | 4912ms |
| Retry Behavior.Does Not Retry On 401 | ✅ | 4989ms |
| Retry Behavior.Respects Retry After Header | ✅ | 7822ms |
| Retry Behavior.Implements Backoff | ✅ | 15492ms |
| Retry Behavior.Retries On 500 | ✅ | 9335ms |
| Retry Behavior.Retries On 502 | ✅ | 8863ms |
| Retry Behavior.Retries On 504 | ✅ | 9335ms |
| Retry Behavior.Max Retries Respected | ❌ | 21305ms |
| Deduplication.Generates Unique Uuids | ✅ | 2991ms |
| Deduplication.Preserves Uuid On Retry | ✅ | 8867ms |
| Deduplication.Preserves Uuid And Timestamp On Retry | ✅ | 16331ms |
| Deduplication.Preserves Uuid And Timestamp On Batch Retry | ✅ | 7870ms |
| Deduplication.No Duplicate Events In Batch | ✅ | 3034ms |
| Deduplication.Different Events Have Different Uuids | ✅ | 2956ms |
| Compression.Sends Gzip When Enabled | ✅ | 2970ms |
| Batch Format.Uses Proper Batch Structure | ✅ | 2761ms |
| Batch Format.Flush With No Events Sends Nothing | ✅ | 442ms |
| Batch Format.Multiple Events Batched Together | ✅ | 3120ms |
| Error Handling.Does Not Retry On 403 | ✅ | 4883ms |
| Error Handling.Does Not Retry On 413 | ✅ | 2533ms |
| Error Handling.Retries On 408 | ✅ | 9277ms |
Failures
retry_behavior.max_retries_respected
Expected 4 requests, got 6
Feature_Flags Tests
✅ 17/17 tests passed
View Details
| Test | Status | Duration |
|---|---|---|
| Request Payload.Request With Person Properties Device Id | ✅ | 2865ms |
| Request Payload.Flags Request Uses V2 Query Param | ✅ | 2877ms |
| Request Payload.Flags Request Hits Flags Path Not Decide | ✅ | 2874ms |
| Request Payload.Flags Request Omits Authorization Header | ✅ | 2877ms |
| Request Payload.Token In Flags Body Matches Init | ✅ | 2935ms |
| Request Payload.Groups Round Trip | ✅ | 2840ms |
| Request Payload.Groups Default To Empty Object | ✅ | 2930ms |
| Request Payload.Disable Geoip False Propagates As Geoip Disable False | ✅ | 2912ms |
| Request Payload.Disable Geoip Omitted Defaults To False | ✅ | 2789ms |
| Request Payload.Flag Keys To Evaluate Contains Only Requested Key | ✅ | 2876ms |
| Request Lifecycle.No Flags Request On Init Alone | ✅ | 113ms |
| Request Lifecycle.No Flags Request On Normal Capture | ✅ | 2865ms |
| Request Lifecycle.Two Flag Calls Produce Two Remote Requests | ✅ | 5726ms |
| Request Lifecycle.Mock Response Value Is Returned To Caller | ✅ | 2813ms |
| Retry Behavior.Retries Flags On 502 | ✅ | 2878ms |
| Retry Behavior.Retries Flags On 504 | ✅ | 2950ms |
| Side Effect Events.Get Feature Flag Captures Feature Flag Called Event | ✅ | 3122ms |
onFeatureFlags(_:) covers it: it reports the loaded flags and whether loading failed, is scoped to one SDK instance, and can be unsubscribed. The notification was posted with a nil object for every instance and carried no data.
turnipdabeets
force-pushed
the
chore/v4-remove-deprecated
branch
from
October 26, 2026 16:28
ce9e3ac to
1fb0c40
Compare
turnipdabeets
force-pushed
the
chore/v4-remove-did-receive-feature-flags
branch
from
October 26, 2026 16:28
2f19c61 to
6f99db6
Compare
dustinbyrne
approved these changes
Oct 26, 2026
2 of 15 tasks
…ceive-feature-flags
4 of 6 tasks
3 of 5 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
Removes
PostHogSDK.didReceiveFeatureFlagsin 4.0 in favor ofonFeatureFlags(_:)(#897), which does the same job better:didReceiveFeatureFlagsonFeatureFlags(_:)object: nilfor every SDK instancePostHogFeatureFlagsLoaded: flags, variants,errorsLoadingNotificationCenter.removeObserversubscription.unsubscribe()setup()The test helper already avoided the notification for the instance problem (see the comment in
TestPostHog.swift). The notification was never deprecated; we're skipping the deprecation cycle because 4.0 is a major.Changes:
PostHogRemoteConfig.notifyFeatureFlags.onFeatureFlags.Wrappers: posthog-flutter observed this notification on iOS/macOS; PostHog/posthog-flutter#649 already moves it to
onFeatureFlags. The React Native plugin doesn't use it.💚 How did you test it?
swift test --filter 'FeatureFlag|RemoteConfig|Flags'with-DTESTING: 179 tests pass.swift build;PostHogExampleandPostHogExampleWithSPMbuild for iOS. The CocoaPods example wasn't built (no CocoaPods locally); its change matches the SPM example's.📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Claude Code (Claude Opus 5.5) found the duplicate while comparing the feature flag APIs across the iOS, Android, Flutter and React Native majors, checked that
onFeatureFlagscovers every case the notification did (it lives on the SDK, survivessetup()/close(), and fires on failed loads too), and made the change. No tests were added because removing an API has no new behavior to cover; the existing listener tests cover the replacement.🤖 Generated with Claude Code