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
Feature Flag Value Changes Unexpectedly After identify Call
Issue Summary
I am experiencing unexpected behavior with feature flags and experiments in PostHog. Even though my feature flag persists across authentication events, its value changes after calling posthog.identify.
The setup is a basic Express server that serves an HTML page. The logic is as follows:
Initialize the PostHog instance.
Subscribe to onFeatureFlags events.
Render all feature flag values on the screen.
Provide an "Identify user" button that triggers posthog.identify on click.
Expected Behavior
When opening the site in an incognito window, waiting for the first flag value to render, and then clicking "Identify user," the feature flag should remain consistent across events.
Observed Behavior
Once in approximately 7–10 attempts, the flag value changes between "control" and "test" after calling posthog.identify.
Steps to Catch the Bug
Modify the id and email inside the HTML to be unique.
Open a new incognito session (not just a new tab).
Wait for the first onFeatureFlags event (flag value renders on the screen).
Click on the "Identify user" button.
Observe if the flag value changes.
Screenshots
Before identify Call: After identify Call:
PostHog Account View:
Additional Information
This inconsistency affects experiment allocation and may lead to unpredictable user experiences. Any insights into why posthog.identify affects the feature flag value would be helpful. Let me know if more details are needed!
Project ID: 23437
The text was updated successfully, but these errors were encountered:
Garkavenko
changed the title
[BUG][FEATURE FLLAGS] Feature flag changes value even if "Flag persistence" enabled
[BUG][FEATURE FLAGS] Feature flag changes value even if "Flag persistence" enabled
Feb 21, 2025
Feature Flag Value Changes Unexpectedly After
identify
CallIssue Summary
I am experiencing unexpected behavior with feature flags and experiments in PostHog. Even though my feature flag persists across authentication events, its value changes after calling
posthog.identify
.Steps to Reproduce
I have created a simple repository to reproduce the issue: posthog-feature-flags-bug-reproduce.
To run the reproduction:
The setup is a basic Express server that serves an HTML page. The logic is as follows:
onFeatureFlags
events.posthog.identify
on click.Expected Behavior
When opening the site in an incognito window, waiting for the first flag value to render, and then clicking "Identify user," the feature flag should remain consistent across events.
Observed Behavior
Once in approximately 7–10 attempts, the flag value changes between "control" and "test" after calling
posthog.identify
.Steps to Catch the Bug
id
andemail
inside the HTML to be unique.onFeatureFlags
event (flag value renders on the screen).Screenshots
Before


identify
Call:After
identify
Call:PostHog Account View:


Additional Information
This inconsistency affects experiment allocation and may lead to unpredictable user experiences. Any insights into why
posthog.identify
affects the feature flag value would be helpful. Let me know if more details are needed!Project ID: 23437
The text was updated successfully, but these errors were encountered: