Repository navigation
docs(flags): record the flags-loaded result Android and Flutter now pass - #158
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
posthog-android 4.0 and posthog-flutter 6.0 move their flag-loaded listeners and reload completions from a payload-free readiness signal to the PostHogFeatureFlagsLoaded shape posthog-ios 4.0 already uses. Update on-feature-flags and reload-feature-flags to match. Proposed, applied and archived on this branch. Generated-By: PostHog Desktop Task-Id: 8ff5e352-d89a-45e5-844b-f93b6b37882c
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 classifies Android and Flutter as readiness-only listeners that "exposea readiness signal with no direct payload; callers re-read flags through getter APIs when notified".
Both SDKs changed that in their next majors, converging on the
PostHogFeatureFlagsLoadedshape thespec already records for posthog-ios 4.0, so the classification and both surface-variant entries are
now wrong.
What changed
Source SDK changes:
PostHogOnFeatureFlagswithPostHogFeatureFlagsCallback, whoseloaded(...)receives aPostHogFeatureFlagsLoaded(flags,variants,errorsLoading). BothPostHogConfig.onFeatureFlagsandreloadFeatureFlags(...)take it.PostHogConfig.onFeatureFlagsfromvoid Function()tovoid Function(PostHogFeatureFlagsLoaded)and
reloadFeatureFlags()fromFuture<void>toFuture<PostHogFeatureFlagsLoaded>.Spec updates:
on-feature-flags: Android (4.0+) and Flutter (6.0+) move into the payload-carrying anderror-aware groups, so the existing failed-load scenario now covers them. Unity stays
readiness-only. Surface variants updated, with the pre-major shapes kept as history.
on-feature-flags: new requirement Flags-loaded result on a payload-carrying listener — thethree pieces of information a payload-carrying listener must carry, that a disabled flag is left
out of the
PostHogFeatureFlagsLoadedshape, and that the result describes the load on everyinvocation path rather than only a successful remote one. Two scenarios.
reload-feature-flags: Android and Flutter surface variants and the Error-handling note updated;the existing Reload completion failure reporting requirement widened past iOS, with one added
scenario for a reload that never issues its request because there is no usable distinct id
(posthog-android#877 reports a blank distinct id as
errorsLoading = true).Validation
openspec validate --specs --strict --no-interactive(CLI 1.4.1, as in CI): 67 passed, 0 failed.git diff --checkis clean.Specification only. No SDK conformance was executed.
Uncertain / needs review
chore/v4-remove-deprecated,chore/v6-adopt-posthog-android-4), notmain. The spec records them as4.0+/6.0+, the sameway posthog-ios 4.0 was recorded before release. If either API is still expected to change before
the major ships, this should wait.
(flags, variants, context)and is not known to omit disabled flags fromvariants, so theomit-disabled rule is scoped to the
PostHogFeatureFlagsLoadedshape. Whether posthog-js shouldconverge is a separate decision.
carrying a payload is a different property, and neither SDK is recorded as doing that.
left SDK-specific; only the distinct-id case has cross-SDK evidence.
on-feature-flagsscenarios reuse the existingpayload-carrying/error-awarelistener-class steps but add "the SDK passes its flag-loaded result as aPostHogFeatureFlagsLoaded" and "the result should not contain …", which need harness bindings.compliance matrix.
Proposed, applied and archived on this branch under
openspec/changes/archive/2026-10-29-record-mobile-flags-loaded-result/.Created with PostHog Desktop
🤖 Generated with Claude Code