Skip to content

test: add server SDK wire snapshots - #186

Merged
dustinbyrne merged 1 commit into
mainfrom
chore/add-server-sdk-snapshot-tests
Aug 18, 2026
Merged

test: add server SDK wire snapshots#186
dustinbyrne merged 1 commit into
mainfrom
chore/add-server-sdk-snapshot-tests

Conversation

@dustinbyrne

Copy link
Copy Markdown
Contributor

💡 Motivation and Context

The coordinated server SDK rollout needs stable wire-format coverage so each SDK can verify the payloads it actually sends for capture batches, feature flags, and exceptions.

This adds deterministic Elixir wire snapshots for that rollout. The tests cover final gzip-decoded /batch JSON (including batching order, nested properties, and duplicate atom/string keys), the complete /flags HTTP envelope, and a sanitized exception event with deterministic timestamp, UUID, and library version. No production code changes are included.

💚 How did you test it?

  • mix test test/posthog/wire_snapshot_test.exs — 3 tests, 0 failures
  • mix format --check-formatted test/posthog/wire_snapshot_test.exs
  • jq empty test/fixtures/wire_snapshots/*.json
  • git diff --cached --check

📝 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.

If releasing new changes

  • Ran sampo add to generate a changeset file

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

A human directed the server SDK snapshot work and requested draft submission. Pi's worker agent finalized and submitted the change (local agent session; no shareable session URL is available). The change remains test-only, the supplied final review found no blockers, and no changeset was added because released behavior is unchanged.

@dustinbyrne dustinbyrne self-assigned this Aug 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

posthog-elixir Compliance Report

Date: 2026-08-17 21:21:06 UTC
Duration: 117661ms

✅ All Tests Passed!

46/46 tests passed


Capture Tests

29/29 tests passed

View Details
Test Status Duration
Format Validation.Event Has Required Fields 611ms
Format Validation.Event Has Uuid 609ms
Format Validation.Event Has Lib Properties 610ms
Format Validation.Distinct Id Is String 610ms
Format Validation.Token Is Present 610ms
Format Validation.Custom Properties Preserved 612ms
Format Validation.Event Has Timestamp 613ms
Retry Behavior.Retries On 503 5616ms
Retry Behavior.Does Not Retry On 400 2612ms
Retry Behavior.Does Not Retry On 401 2611ms
Retry Behavior.Respects Retry After Header 5616ms
Retry Behavior.Implements Backoff 15626ms
Retry Behavior.Retries On 500 5616ms
Retry Behavior.Retries On 502 5615ms
Retry Behavior.Retries On 504 5615ms
Retry Behavior.Max Retries Respected 15620ms
Deduplication.Generates Unique Uuids 620ms
Deduplication.Preserves Uuid On Retry 5615ms
Deduplication.Preserves Uuid And Timestamp On Retry 10621ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry 5618ms
Deduplication.No Duplicate Events In Batch 615ms
Deduplication.Different Events Have Different Uuids 613ms
Compression.Sends Gzip When Enabled 609ms
Batch Format.Uses Proper Batch Structure 609ms
Batch Format.Flush With No Events Sends Nothing 608ms
Batch Format.Multiple Events Batched Together 616ms
Error Handling.Does Not Retry On 403 2611ms
Error Handling.Does Not Retry On 413 2613ms
Error Handling.Retries On 408 5614ms

Feature_Flags Tests

17/17 tests passed

View Details
Test Status Duration
Request Payload.Request With Person Properties Device Id 610ms
Request Payload.Flags Request Uses V2 Query Param 609ms
Request Payload.Flags Request Hits Flags Path Not Decide 611ms
Request Payload.Flags Request Omits Authorization Header 609ms
Request Payload.Token In Flags Body Matches Init 610ms
Request Payload.Groups Round Trip 610ms
Request Payload.Groups Default To Empty Object 610ms
Request Payload.Disable Geoip False Propagates As Geoip Disable False 610ms
Request Payload.Disable Geoip Omitted Defaults To False 609ms
Request Payload.Flag Keys To Evaluate Contains Only Requested Key 610ms
Request Lifecycle.No Flags Request On Init Alone 4ms
Request Lifecycle.No Flags Request On Normal Capture 608ms
Request Lifecycle.Two Flag Calls Produce Two Remote Requests 1216ms
Request Lifecycle.Mock Response Value Is Returned To Caller 610ms
Retry Behavior.Retries Flags On 502 913ms
Retry Behavior.Retries Flags On 504 912ms
Side Effect Events.Get Feature Flag Captures Feature Flag Called Event 1213ms

@dustinbyrne
dustinbyrne marked this pull request as ready for review August 17, 2026 21:28
@dustinbyrne
dustinbyrne requested a review from a team as a code owner August 17, 2026 21:28
@dustinbyrne
dustinbyrne marked this pull request as draft August 17, 2026 21:29
@greptile-apps

greptile-apps Bot commented Aug 17, 2026

Copy link
Copy Markdown

Reviews (1): Last reviewed commit: "test: add server SDK wire snapshots" | Re-trigger Greptile

@dustinbyrne
dustinbyrne marked this pull request as ready for review August 17, 2026 21:33
@greptile-apps

greptile-apps Bot commented Aug 17, 2026

Copy link
Copy Markdown

Reviews (2): Last reviewed commit: "test: add server SDK wire snapshots" | Re-trigger Greptile

@dustinbyrne
dustinbyrne merged commit b5a2ba3 into main Aug 18, 2026
33 checks passed
@dustinbyrne
dustinbyrne deleted the chore/add-server-sdk-snapshot-tests branch August 18, 2026 14:53
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.

2 participants