fix(flags): align local string matching with the flags service - #238
Merged
Conversation
Contributor
posthog-rs-v0 Compliance ReportDate: 2026-08-28 06:16: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
|
Contributor
posthog-rs-v1 Compliance ReportDate: 2026-08-28 06:16:44 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
|
Prompt To Fix All With AI### Issue 1
src/feature_flags.rs:1720-1742
**Parameterize comparison cases**
The new comparison matrix repeats individual assertions instead of using parameterized cases, making additions more repetitive and failures less descriptive than the existing table-driven operator-test pattern.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "fix(flags): align local string matching ..." | Re-trigger Greptile |
ioannisj
approved these changes
Aug 27, 2026
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 feature flag evaluation must match the currently released
/flagsservice until its behavior changes. The service applies boolean-like truthiness before ordinary array membership forexactandis_not. This includes all-boolean arrays and the vacuous truthiness of an empty array.The separate backend proposal in PostHog/posthog#90694 would replace those semantics. This PR intentionally does not adopt that draft behavior.
This fixes PostHog/posthog#78019 by:
is_notas the direct complement ofexactexactandis_notThe patch changeset for
cargo/posthog-rsdescribes the complete matching update.💚 How did you test it?
cargo test test_exact_boolean_coercion_matches_flags_service -- --nocapturefailed atexactwith filterfalseand property"banana".cargo test test_property_case_folding_matches_flags_service -- --nocapturecargo testcargo fmt --all -- --checkcargo clippy -- -D warningsscripts/check-public-api.shautoreview --mode localThe test suite emits existing deprecation warnings from httpmock-based tests. No test failed.
📝 Checklist
If releasing new changes
sampo addto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Implemented with Pi using the address-pr-comments, check-pr, autoreview, and karpathy-guidelines skills. Verification showed that Rust and serde_json already match the service's Unicode and JSON behavior, so production changes remain limited to boolean-like precedence.