-
Notifications
You must be signed in to change notification settings - Fork 32
included evaluated_at properties in $feature_flag_called events
#321
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
base: main
Are you sure you want to change the base?
Conversation
| val flags: Map<String, FeatureFlag>? = null, | ||
| val quotaLimited: List<String>? = null, | ||
| val requestId: String?, | ||
| val evaluatedAt: Long?, |
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.
add the @property comment docs above, also for requestId just noticed its missing
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 do!
dustinbyrne
left a comment
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.
Looks good! I left a couple of comments below. Also needs CHANGELOG entries.
| // value should never be nullabe anyway | ||
| props["\$feature_flag_response"] = value ?: "" | ||
| props["\$feature_flag_request_id"] = requestId ?: "" | ||
| props["\$feature_flag_evaluated_at"] = evaluatedAt ?: "" |
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.
This is either a long or a string depending on whether or not evaluatedAt is null. Does this introduce a chance of creating the $feature_flag_evaluated_at property definition with the wrong type? If so, maybe we only write it when it's non-null
| props["\$feature_flag_evaluated_at"] = evaluatedAt ?: "" | |
| evaluatedAt?.let { props["\$feature_flag_evaluated_at"] = it } |
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.
d'oh; you're so right
| // no-op by default | ||
| } | ||
|
|
||
| public fun getRequestId( |
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.
There's a PostHogFeatureFlagsInterface implemented somewhere in the tests which will need the new methods.
evaluated_at properties in $feature_flag_called events
💡 Motivation and Context
See PostHog/posthog#41824 for context\
💚 How did you test it?
New unit tests
📝 Checklist