test: verify SDK timestamps use UTC - #185
Merged
Merged
Conversation
Contributor
posthog-elixir Compliance ReportDate: 2026-08-14 06:10:23 UTC ✅ All Tests Passed!46/46 tests passed Capture Tests✅ 29/29 tests passed View Details
Feature_Flags Tests✅ 17/17 tests passed View Details
|
marandaneto
marked this pull request as ready for review
August 14, 2026 08:44
|
Reviews (1): Last reviewed commit: "test: verify SDK timestamps use UTC" | Re-trigger Greptile |
arnohillen
approved these changes
Aug 14, 2026
arnohillen
left a comment
There was a problem hiding this comment.
(created by claude code)
[arno's agent] Verified at a77ca8c: test-only; the SDK's only emission path is DateTime.utc_now() |> to_iso8601() and the public API accepts no user timestamp, so the offset-conversion requirement has no surface here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💡 Motivation and Context
PostHog.bare_capture/3adds an SDK-generated event timestamp in UTC. This test protects that behavior while confirming that aDateTimesupplied as an event property keeps its original time zone offset.The regression test captures an event with an
Asia/Kathmanduproperty. It verifies that the generated event timestamp ends inZand parses with a zero UTC offset. It also verifies that the captured property remains the originalDateTimevalue and that JSON encoding produces2024-01-02T03:04:05.678+05:45for that property.💚 How did you test it?
mix test test/posthog_test.exs- 28 tests passed.mix test- 332 tests passed and 18 integration tests were excluded.mix format --check-formatted test/posthog_test.exsgit diff --check origin/main...HEAD📝 Checklist
If releasing new changes
sampo addto generate a changeset fileNo changeset was added because this PR only adds regression coverage and does not release a product change.
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Pi's worker agent preserved the existing test-only change, ran the repository tests, and completed an isolated autoreview. The task was kept to regression coverage with no production or release metadata changes. A shareable agent session link was not available in this environment.