-
Notifications
You must be signed in to change notification settings - Fork 32
fix!: Correctly type user and group properties #312
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
Changes from 4 commits
34f849a
e10886d
dd70e0e
e824ce6
7fef939
40597c7
886d3a2
5f6f11a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,8 +59,8 @@ public class PostHog : PostHogInterface { | |
| key: String, | ||
| defaultValue: Boolean, | ||
| groups: Map<String, String>?, | ||
| personProperties: Map<String, String>?, | ||
| groupProperties: Map<String, String>?, | ||
| personProperties: Map<String, Any?>?, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we prob should normalize all params with
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. GSON should be able to do this automatically but I'll include a test to verify
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this address your concerns? I'd started looking at normalizing into primitive JSON types, but it seems GSON's default behavior may suffice.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. probably yes, we do this on iOS https://github.com/PostHog/posthog-ios/blob/ba5dd65d2341ab8ea1949f072594ef67c490af3a/PostHog/Utils/DictUtils.swift#L10 |
||
| groupProperties: Map<String, Map<String, Any?>>?, | ||
| ): Boolean { | ||
| return instance?.isFeatureEnabledStateless( | ||
| distinctId, | ||
|
|
@@ -77,8 +77,8 @@ public class PostHog : PostHogInterface { | |
| key: String, | ||
| defaultValue: Any?, | ||
| groups: Map<String, String>?, | ||
| personProperties: Map<String, String>?, | ||
| groupProperties: Map<String, String>?, | ||
| personProperties: Map<String, Any?>?, | ||
| groupProperties: Map<String, Map<String, Any?>>?, | ||
| ): Any? { | ||
| return instance?.getFeatureFlagStateless( | ||
| distinctId, | ||
|
|
@@ -95,8 +95,8 @@ public class PostHog : PostHogInterface { | |
| key: String, | ||
| defaultValue: Any?, | ||
| groups: Map<String, String>?, | ||
| personProperties: Map<String, String>?, | ||
| groupProperties: Map<String, String>?, | ||
| personProperties: Map<String, Any?>?, | ||
| groupProperties: Map<String, Map<String, Any?>>?, | ||
| ): Any? { | ||
| return instance?.getFeatureFlagPayloadStateless( | ||
| distinctId, | ||
|
|
||
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.
will this break the public API if someone declare and pass a
Map<String, String>? should we raise a major?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.
Yeah, this is technically a major version bump in both packages. Hopefully this should be the last for a while.