{{ message }}
Repository navigation
feat: add group_identify helper for creating and updating group properties - #232
Merged
Merged
Conversation
marandaneto
reviewed
Aug 24, 2026
marandaneto
left a comment
Member
There was a problem hiding this comment.
Automated advisory code review.
Member
Member
you need to sign your commits and force push |
Member
Strip the UTF-8 BOM from the changeset front matter that was breaking sampo release parsing, and make group_identify reject non-object properties (PostHog silently drops $group_set otherwise) by returning Result<(), Error> instead of swallowing serialization failures.
marandaneto
force-pushed
the
feat/group-identify-helper
branch
from
August 24, 2026 12:05
a8bb180 to
f0daad4
Compare
marandaneto
approved these changes
Aug 24, 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
Closes #150.
Adds a first-class
group_identifyhelper so users no longer need to hand-build the$groupidentifyevent:Available on both the async and blocking clients with the same signature.
Implementation Details & Design Decisions
Payload Structure & Wire Format
"$groupidentify".distinct_idis set toformat!("${group_type}_{group_key}")(e.g."$company_company_id_in_your_db"), matchingposthog-js(posthog-core-stateless/posthog-node),posthog-python, and the PostHog group analytics specification.$group_type,$group_key, and$group_set: properties.Synchronous Construction & Fire-and-Forget Delivery
captureandalias, the helper synchronously constructs and enqueues the event on both async and blocking clients; delivery remains fire-and-forget.group_type: impl Into<String>,group_key: impl Into<String>, andproperties: impl Serialize.group_typeorgroup_keycannot describe a valid group identification and are dropped with a warning, matchingposthog-python.Error::Serializationto the caller.Event::group_identifyso both clients share the exact same payload definition and validation logic.💚 How did you test it?
tests/test_group_identify.rscovering bothasync_clientandblockingclients across all key scenarios:$groupidentifypayload verification ($group_type,$group_key,$group_set)group_typeandgroup_keydropssrc/event.rs:v0_group_identify_payloadgroup_identify_rejects_blank_keyscargo test --test test_group_identify(6 passed)cargo test --no-default-features --test test_group_identify(6 passed)cargo test --lib event(34 passed)cargo test --doc(7 passed)cargo clippy -- -D warnings(clean)cargo fmt --check(clean)api/public-api.txtsnapshot updated.sampo/changesets/add-group-identify-helper.md📝 Checklist
.sampo/changesets/add-group-identify-helper.md).