-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(flags): store setOnce properties in locally persisted feature flag props #1716
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR modifies the feature flag property persistence in posthog-js to include setOnce
properties, ensuring they are stored locally and only used for /decide
calls without affecting existing property values.
- Modified
identify
andsetPersonProperties
methods in/src/posthog-core.ts
to mergeuserPropertiesToSetOnce
withuserPropertiesToSet
- Properties are only used for feature flag
/decide
calls, preventing unintended overwrites of existing values - Changes maintain backwards compatibility and work consistently across browsers
- Functionality verified through existing feature flag and identify tests in
/functional_tests/
and/playwright/
1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
Size Change: +312 B (+0.01%) Total Size: 3.3 MB
ℹ️ View Unchanged
|
Changes
Context: https://posthoghelp.zendesk.com/agent/tickets/24489
Include
setOnce
properties in the locally persisted feature flag person properties: https://posthog.com/docs/feature-flags/adding-feature-flag-code#automatic-overridesThese are stored in local storage, but only used by feature flags for passing into the
/decide
call. This means that we should be safe fromsetOnce
properties inadvertently overwriting previous property values.Checklist