You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[browser-next] resetGroups retains persisted group flag properties when flags is absent #5673
In experimental @posthog/browser, analytics.resetGroups() clears group membership but leaves persisted group properties used for flag evaluation when the flags product is absent. A later client that installs flags can send that retained context again.
Reproduction
Use the same project token and storage across these loads:
Reload with flags: false, acquire analytics, and call:
analytics.resetGroups()
Reload with flags installed and inspect the next flag-evaluation request.
Membership is cleared, but $stored_group_properties in the featureFlags storage namespace still contains { company: { plan: 'paid' } } and can appear in group_properties.
Expected behavior
Group-only reset durably clears both memberships and group flag-property overrides, independently of whether flags is installed. Identity, sessions, person properties, cached flag values and unrelated stored context remain intact.
Evidence and scope
Follow-up to #5655 and its review finding. Reproduced against the stack's built output at 728e13f70ddf55812ea85696e0c700ab66e5d52d: memberships became {}, while the stored company properties remained.
Core reset currently clears only memberships. Durable flag-property removal depends on the optional flags product's onGroupsReset listener. Cleanup should remain Core-owned and should not require loading the flags implementation.
Hi @dustinbyrne, I'd like to work on this if it's still open for outside help.
Plan:
Make analytics.resetGroups() in @posthog/browser clear $stored_group_properties in the featureFlags storage namespace directly, rather than relying on the flags product being installed. Keep identity, sessions, person properties and cached flag values untouched.
Add a test for your reproduction: group with properties → reload with flags: false → resetGroups() → reload with flags, and assert the next flag request has no group_properties for the reset group.
Would you like it as a follow-up PR on top of the #5655 work, or against main?
Activity
posthog commentedon Nov 11, 2026
PostHog self-driving picked up this issue. Status: Research is done.
Somebody may already be working on it, so ask before you start a fix.
Report (team access only): https://us.posthog.com/project/2/inbox/reports/01a1cc1f-28ca-75d9-ba3b-0d8161fbd9d1?link_source=github_comment
rahulsjha commentedon Nov 14, 2026
Hi @dustinbyrne, I'd like to work on this if it's still open for outside help.
Plan:
analytics.resetGroups()in@posthog/browserclear$stored_group_propertiesin thefeatureFlagsstorage namespace directly, rather than relying on the flags product being installed. Keep identity, sessions, person properties and cached flag values untouched.flags: false→resetGroups()→ reload with flags, and assert the next flag request has nogroup_propertiesfor the reset group.Would you like it as a follow-up PR on top of the #5655 work, or against
main?