fix(flags)!: honor versioned local property matching - #248
Draft
marandaneto wants to merge 1 commit into
Draft
Conversation
Keep matching versions with definition snapshots across refreshes and recursive evaluation. Preserve legacy matching unless the version is exactly 2. BREAKING CHANGE: LocalEvaluationResponse and EvaluationContext struct literals require property_matching_version. Use 1 for legacy behavior. Include a minor Sampo changeset for the pre-1.0 crate.
Contributor
posthog-rs-v0 Compliance ReportDate: 2026-09-05 12:49:41 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
|
Contributor
posthog-rs-v1 Compliance ReportDate: 2026-09-05 12:49:46 UTC ✅ All Tests Passed!111/111 tests passed Capture_V1 Tests✅ 94/94 tests passed View Details
Feature_Flags Tests✅ 17/17 tests passed View Details
|
marandaneto
marked this pull request as ready for review
September 5, 2026 17:29
|
Reviews (1): Last reviewed commit: "fix(flags)!: honor versioned local prope..." | Re-trigger Greptile |
marandaneto
marked this pull request as draft
September 6, 2026 07:00
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
Local flag evaluation needs to use the property matching version returned with flag definitions. Without it, version 2 definitions still use legacy boolean coercion. For example, a
falsefilter matches"banana"under legacy matching but should not match under version 2.This follows the backend behavior and shared SDK contract. Optional shared harness coverage is separate. This PR does not opt the Rust adapter into that coverage.
Changes
property_matching_versionwith a default of 1. Exactly 2 uses explicit scalar equality and member equality for nonempty filter arrays. Missing metadata and other versions keep released legacy matching.is_notcomplementsexact. Missing properties remain inconclusive.Source compatibility
This is source-breaking for public struct-literal callers. Callers constructing
LocalEvaluationResponseorEvaluationContextmust addproperty_matching_version: 1for legacy behavior, or pass the version associated with their definitions. Older serialized definitions still load without this field. The context-freematch_feature_flaghelper remains legacy.The existing Sampo changeset is minor because this crate is pre-1.0 (
0.25.x). The public API snapshot includes both new fields.💚 How did you test it?
The committed tree matches the previously validated implementation exactly.
cargo test --offline --test test_property_matching_version: 8 passed. Coverage includes wire matching cases, version-only refreshes, older serialized definitions, missing properties, propagation, blocking and async pollers, HTTP failure/304 preservation, the legacy helper, and concurrent snapshots.origin/main: clean, no actionable findings, on4c50b3ecdeef4bdcfdf5d78cc966c1c742a57a12.cargo fmt -- --check,scripts/check-public-api.sh, and focused default-feature Clippy with-D warnings.Known pre-existing strict all-target/no-default Clippy warnings remain out of scope. Live-service/e2e and capture-v1 runtime suites were not run. Local results do not establish CI success.
📝 Checklist
If releasing new changes
sampo addto generate a changeset file. The existing manually maintained.sampo/changesets/versioned-property-matching.mdis included withcargo/posthog-rs: minor.