Skip to content
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

Merged
merged 3 commits into from
Feb 5, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/posthog-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1427,7 +1427,10 @@ export class PostHog {
this.persistence.set_property(USER_STATE, 'identified')

// Update current user properties
this.setPersonPropertiesForFlags(userPropertiesToSet || {}, false)
this.setPersonPropertiesForFlags(
marandaneto marked this conversation as resolved.
Show resolved Hide resolved
{ ...(userPropertiesToSetOnce || {}), ...(userPropertiesToSet || {}) },
false
)

this.capture(
'$identify',
Expand Down Expand Up @@ -1484,7 +1487,7 @@ export class PostHog {
}

// Update current user properties
this.setPersonPropertiesForFlags(userPropertiesToSet || {})
this.setPersonPropertiesForFlags({ ...(userPropertiesToSetOnce || {}), ...(userPropertiesToSet || {}) })

// if exactly this $set call has been sent before, don't send it again - determine based on hash of properties

Expand Down
Loading