Repository navigation
docs(on-feature-flags): record Android's runtime flag listener registration - #161
Draft
posthog[bot] wants to merge 1 commit into
Draft
posthog[bot] wants to merge 1 commit into
posthog[bot] wants to merge 1 commit into
Conversation
…ration posthog-android 4.0 adds onFeatureFlags(callback) returning an unsubscribable subscription, replaying current values to a late-registered listener and delivering on the main thread. The spec listed Android as config-field only and named browser and iOS as the only replaying surfaces. Also states the lifetime of a runtime listener registration and that a load discarded by reset() or close() reaches no listener. Generated-By: PostHog Desktop Task-Id: 0f06e86a-cfe0-4675-879c-f62409de4f6c
turnipdabeets
added a commit
that referenced
this pull request
Oct 30, 2026
openspec validate --strict only reads the first line of a requirement, which is what fails on #161.
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.
Why
The
on-feature-flagsspec records Android's only listener surfaces as the config fieldPostHogConfig.onFeatureFlagsand thereloadFeatureFlags(...)completion, and Behavior item 5 names browser and iOS as the only SDKs that invoke a listener registered after flags are already loaded.posthog-android#878 (merged into the 4.0 line) changes that. It adds
PostHog.onFeatureFlags(PostHogFeatureFlagsCallback)— on the instance and the static facade — returning aPostHogFeatureFlagsSubscriptionwithunsubscribe(), replays the current flags to a late subscriber, and delivers on the main thread. It matches posthog-ios 4.0'sonFeatureFlags(_:)and posthog-js'sonFeatureFlags, which the spec already records as method-style surfaces.What changed in the spec
onFeatureFlags(...)registration joins browser and iOS as a surface that replays current values to a late-registered listener. Android's config field and reload completion are explicitly not in that group.onFeatureFlags(...)listeners on the main thread, config callback and reload completion on the background thread — the same split posthog-ios makes.unsubscribe()(including across aclose()/setup()cycle), and a load already in flight whenreset()orclose()ran reaches no listener and is not replayed to a later one.Proposed, applied and archived on this branch under
openspec/changes/archive/2026-10-30-record-android-flag-listener-subscription/, asAGENTS.mdasks.openspec validate on-feature-flags --type spec --strictpasses.Uncertain / for review
close()/setup()".PostHogFeatureFlagsCallbackpayload shape from docs(flags): record the flags-loaded result Android and Flutter now pass #158 and the subscription surface from here.spec.mdonly;acceptance/has no harness steps for a teardown/re-setup cycle or for a load completing afterreset().Created with PostHog Desktop
🤖 Generated with Claude Code