Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .sampo/changesets/group-and-mixed-targeting-local-eval.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
cargo/posthog-rs: minor
---

feat(flags): support group-targeted and mixed-targeting feature flags in local evaluation

Adds local evaluation support for pure group flags (where `aggregation_group_type_index` is set at the flag level) and mixed-targeting flags (where individual conditions can override the aggregation per condition). `LocalEvaluator::evaluate_flag`, `evaluate_flag_simple`, and `evaluate_all_flags` now take `groups` and `group_properties` parameters; `match_feature_flag` and `match_feature_flag_with_context` have updated signatures. Backwards-incompatible at the public-API level — see PR description for migration notes.
8 changes: 0 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
# posthog-rs

## 0.7.0 — 2026-05-05

### Minor changes

- [e976393](https://github.com/posthog/posthog-rs/commit/e976393182c5bfe1527cc180e732ce51482c87e0) feat(flags): support group-targeted and mixed-targeting feature flags in local evaluation

Adds local evaluation support for pure group flags (where `aggregation_group_type_index` is set at the flag level) and mixed-targeting flags (where individual conditions can override the aggregation per condition). `LocalEvaluator::evaluate_flag`, `evaluate_flag_simple`, and `evaluate_all_flags` now take `groups` and `group_properties` parameters; `match_feature_flag` and `match_feature_flag_with_context` have updated signatures. Backwards-incompatible at the public-API level — see PR description for migration notes. — Thanks @patricio-posthog!

## 0.6.0 — 2026-05-01

### Minor changes
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "posthog-rs"
license = "MIT"
version = "0.7.0"
version = "0.6.0"
authors = ["PostHog <engineering@posthog.com>"]
description = "The official Rust client for Posthog (https://posthog.com/)."
repository = "https://github.com/posthog/posthog-rs"
Expand Down
9 changes: 8 additions & 1 deletion src/client/async_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,14 @@ impl Client {

if let Some(evaluator) = &self.local_evaluator {
let person_props_owned = options.person_properties.clone().unwrap_or_default();
let local_results = evaluator.evaluate_all_flags(&distinct_id, &person_props_owned);
let groups_owned = options.groups.clone().unwrap_or_default();
let group_props_owned = options.group_properties.clone().unwrap_or_default();
let local_results = evaluator.evaluate_all_flags(
&distinct_id,
&person_props_owned,
&groups_owned,
&group_props_owned,
);
for (key, result) in local_results {
if let Some(filter) = &options.flag_keys {
if !filter.iter().any(|k| k == &key) {
Expand Down
9 changes: 8 additions & 1 deletion src/client/blocking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,14 @@ impl Client {

if let Some(evaluator) = &self.local_evaluator {
let person_props_owned = options.person_properties.clone().unwrap_or_default();
let local_results = evaluator.evaluate_all_flags(&distinct_id, &person_props_owned);
let groups_owned = options.groups.clone().unwrap_or_default();
let group_props_owned = options.group_properties.clone().unwrap_or_default();
let local_results = evaluator.evaluate_all_flags(
&distinct_id,
&person_props_owned,
&groups_owned,
&group_props_owned,
);
for (key, result) in local_results {
if let Some(filter) = &options.flag_keys {
if !filter.iter().any(|k| k == &key) {
Expand Down