Skip to content

Do not capture $set event if user props have not changedΒ #251

@marandaneto

Description

@marandaneto

Description

https://github.com/PostHog/posthog-js/blob/c8c747a53c4768686542899631ebbe440ab39760/src/posthog-core.ts#L1589-L1593

Relates to #194

  • Android/Flutter
  • iOS/Flutter
  • RN - requires this too

capture(
"\$set",
distinctId = distinctId,
userProperties = userProperties,
userPropertiesSetOnce = userPropertiesSetOnce,
)

this line should only be executed if userProperties or userPropertiesSetOnce have changed from previous calls.
we should cache userProperties and userPropertiesSetOnce in the cachePreferences to be able to compare

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions