Skip to content

Conversation

@dmarticus
Copy link
Contributor

@dmarticus dmarticus commented Nov 20, 2025

💡 Motivation and Context

See PostHog/posthog#41824 for context\

💚 How did you test it?

New unit tests

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

@dmarticus dmarticus requested a review from a team as a code owner November 20, 2025 21:52
val flags: Map<String, FeatureFlag>? = null,
val quotaLimited: List<String>? = null,
val requestId: String?,
val evaluatedAt: Long?,
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do!

Copy link
Contributor

@dustinbyrne dustinbyrne left a 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 ?: ""
Copy link
Contributor

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

Suggested change
props["\$feature_flag_evaluated_at"] = evaluatedAt ?: ""
evaluatedAt?.let { props["\$feature_flag_evaluated_at"] = it }

Copy link
Contributor Author

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(
Copy link
Contributor

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.

@dmarticus dmarticus changed the title included evaluated_at properties in $feature_flag_called events included evaluated_at properties in $feature_flag_called events Nov 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants