Repository navigation
fix: defensively filter failed normalized cache records only - #8
Merged
Merged
Conversation
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
Related to PostHog/sdk-specs#211.
This is a LIMITED defensive normalized-cache fix only, not end-to-end wire conformance. If a normalized record contains
failed: true, the C++ cache currently accepts its placeholder value and payload. Skip that record before reading either field. The shared parser also filters restored records.Healthy false values remain valid. Complete nonerrored refreshes replace state after filtering. Response-wide errored refreshes keep prior successful values, paired payloads, and source metadata. Existing caller defaults and missing-read behavior are unchanged. There are no breaking changes.
The actual
phu_flagsbridge serializesflags.export()from an external Rust embedding checkout. The inspected exporter loses failure identity before C++ receives the records, so this guard cannot detect those already-normalized placeholders. The requiredPOSTHOG_RS_PATHcheckout is unavailable. An audited failure-aware exporter and an approved immutable dependency pin are still needed before actual ABI, public-getter, and enrichment wire conformance can be established. This PR does not change the ABI or dependency pin.Release intent is a patch-level defensive fix. This repository has no existing release-intent mechanism, so no changeset or version bump was invented.
How did you test it?
Automation RunTests PostHog.passedPostHog.FailedFlagCacheand neighboringPostHog.FlagCache: 2 succeeded, 0 failed, 0 warnings, 0 not run. This is cache-level testing, not a full plugin link or an exporter substitute.PostHog.FailedFlagCachefailing on leaked failed values/payloads, stale-state replacement, and overwritten successful pairs. The current test passes. Cases cover complete and response-wide errored refreshes, healthy false controls, retained source metadata, restore filtering, and all-failed records including a missing value.git diff --checkpassed. The required branch autoreview againstorigin/mainreported no actionable findings.bash scripts/build-native.sh aarch64-apple-darwinis blocked becausePOSTHOG_RS_PATHis absent. Full native/plugin, ABI, public-getter wire, and platform-matrix validation were not completed. No shared-harness conformance is claimed.Checklist
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Pi assisted with the implementation and publication using local file and shell tools, Git, GitHub CLI, and the configured autoreview helper. The human-directed scope was limited to the defensive normalized-cache filter, cache tests, and documentation. No public agent-session link is available.
The exporter limitation is documented rather than hidden behind a replacement exporter, speculative ABI, new missing-read tracking, or invented release metadata. Human review is required before merge.