fix(browser): gate group() on person processing - #4713
Open
posthog[bot] wants to merge 1 commit into
Open
Conversation
group() was the one identity method that skipped _requirePersonProcessing. Under person_profiles 'never' or 'identified_only' before an identify, the $groupidentify event went out stamped $process_person_profile: false, and the server dropped it. The group was never created or updated, and the SDK logged nothing. Gate group() like identify(), alias(), and setGroupPropertiesForFlags(): it now promotes the user to identified under 'identified_only' and logs an error under 'never'. Generated-By: PostHog Desktop Task-Id: ecd71523-a255-4b1d-8226-6bed53a9a671
Contributor
Contributor
posthog-js Compliance ReportDate: 2026-09-01 07:32:34 UTC ✅ All Tests Passed!26/26 tests passed Capture Tests✅ 26/26 tests passed View Details
|
Contributor
|
Size Change: +522 B (0%) Total Size: 20.7 MB 📦 View Changed
ℹ️ View Unchanged
|
turnipdabeets
marked this pull request as ready for review
September 1, 2026 21:02
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.
Problem
group()is the one identity method that skips_requirePersonProcessing.identify(),alias(),setPersonProperties(), andsetGroupPropertiesForFlags()all gate on it;group()callscapture($groupidentify)straight through.person_profiles: 'never'(oridentified_onlybefore an identify), the$groupidentifyevent goes out stamped$process_person_profile: false, and the server drops it asinvalid_event_when_process_person_profile_is_false. The group is never created or updated, and the only trace is an ingestion warning.Changes
group()on_requirePersonProcessing('posthog.group'), so it matches every other identity method in the same file.identified_only: agroup()call now promotes the user to identified, so the$groupidentifyevent is kept instead of dropped.never: the call is ignored and logs the standard error, instead of sending an event the server always drops.group/neverunit test, which previously asserted the dropped-event behavior, to assert the event is not sent and the error is logged.Testing
jest src/__tests__/personProcessing.test.ts— 46 pass, including bothgroupcases (identified_onlypromotion,neverignored).jestovergroup-before-identify-bug,posthog-core,posthog-core-also,featureflags,posthog-core.loaded— no regressions from theidentified_onlypromotion.group()with and without properties underidentified_only; theneverpath logging one error and sending no$groupidentify.Release info Sub-libraries affected
Libraries affected
Checklist
If releasing new changes
pnpm changesetto generate a changeset file🤖 Agent context
Autonomy: Fully autonomous
Authored by PostHog self-driving (Claude Code), from an inbox report about dropped
$groupidentifyevents.group()was the only identity method that did not call_requirePersonProcessing. The fix matches the existing sibling pattern in the same file.capture($groupidentify)call, but chose to gate the whole method (right after input validation, likeidentify()), so anever-mode call does not half-apply local$groupsstate it can never sync.Created with PostHog Desktop from this inbox report.