Repository navigation
fix: Treat failed feature flag records as unavailable - #970
Merged
Merged
Conversation
Contributor
posthog-android Compliance ReportDate: 2026-11-12 13:49:28 UTC ✅ All Tests Passed!46/46 tests passed Capture Tests✅ 29/29 tests passed View Details
Feature_Flags Tests✅ 17/17 tests passed View Details
|
marandaneto
marked this pull request as ready for review
November 12, 2026 12:13
Contributor
There was a problem hiding this comment.
PostHog Review · Standard · reviewed a63ed08: 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.
8 of 19 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
Detailed
/flagsrecords withfailed: truemust represent unavailable evaluations, not disabled values or placeholder variants/payloads. Implements the failed-record contract in PostHog/sdk-specs#211 while keeping existing API and refresh policies:evaluation_failed, notflag_missing; preserve response-wide errors independently and use the existing empty-string missing-response sentinel instead of a caller default. Event suppression/deduplication remain unchanged.No new public API, dependency, DTO nullability or stateless/server deserialization-hardening change. Snapshot inclusion, unresolved-read and event policies are unchanged except filtering failed remote values and retaining existing successful local pairs. No intentional divergence from the touched sdk-specs #211 behavior.
The existing changeset requests patch releases for core, Android, server, Compose surveys and server OpenFeature. No redundant release intent or manual version bumps were added.
💚 How did you test it?
At final reviewed HEAD
1a7a9e1cfa357b142c269efa1e83dc79d76de37a:/local_evaluationHTTP count became 2 instead of 1 on the second cached bulk read and secondappendFeatureFlagscapture. The same two tests now pass, including cold-context retry, original failure provenance, healthy false/payload controls and manual recovery with existing cache replacement.metadata.idNPE for first scalar/structured tracked reads, live and after JSON-cache reopen. All four tests now pass across response-wide error-bit true/false/absent, optional reason, defaults, event suppression/dedupe, healthy false metadata enrichment and healthy variant/payload controls. Valid failed metadata remains asserted../gradlew :posthog:test :posthog-server:test). An initial 120-second tool timeout was terminated; an authorized unchanged-source rerun with a longer local timeout passed in 3m52s. This was not counted as a failing test or reproduction../gradlew :posthog-android:testReleaseUnitTest --tests 'com.posthog.android.internal.PostHogSharedPreferencesTests').make checkFormat, core/serverapiCheck, corelint, core/serveranimalsnifferMainandgit diff --checkpass. Focused regressions and healthy-precedence/local-pair/valid-metadata controls were rerun after formatting-only edits and pass.autoreview --mode branch --base origin/mainis clean on the exact final HEAD above, based753954d53e62b715d810c2e91d02b11534edf8c(TruffleHog clean; no accepted/actionable findings). All three branch commits have locally verified good signatures.Local Gradle validation used the installed Java 21 via command-local
JAVA_HOME,JAVA_TOOL_OPTIONS=-Dnet.bytebuddy.experimental=true, and the existing Android SDK. No dependency installs, toolchain changes or lockfile churn. Full Android suites, Compose, OpenFeature, device/instrumentation, all-module build/release checks, remote CI and the shared cross-SDK harness were not run in this follow-up. Older caches cannot recover response-wide errors that older SDKs never stored. Prior branch red evidence was not regenerated here; the two review concerns have newly executed red/green evidence.📝 Checklist
If releasing new changes
🤖 Agent context
Autonomy: Human-driven (agent-assisted). Human DRI: @marandaneto. Pi implemented the approved fixes and ran the tests, source/test audit, and isolated autoreview listed above. Human review is required before merge. No shareable session link is available.