Skip to content

feat: emit $is_server property on captured events#126

Merged
turnipdabeets merged 6 commits into
mainfrom
feat/add-is-server-property
Jun 3, 2026
Merged

feat: emit $is_server property on captured events#126
turnipdabeets merged 6 commits into
mainfrom
feat/add-is-server-property

Conversation

@turnipdabeets

Copy link
Copy Markdown
Contributor

Adds $is_server: true to every event captured by this SDK so PostHog ingestion can identify server-side events.

@turnipdabeets turnipdabeets requested review from a team and rafaeelaudibert as code owners June 2, 2026 19:36
@greptile-apps

greptile-apps Bot commented Jun 2, 2026

Copy link
Copy Markdown

Comments Outside Diff (1)

  1. test/posthog_test.exs, line 115-116 (link)

    P2 The "ignores set context" test asserts $lib and $lib_version from @system_global_properties but was not updated to also assert "$is_server": true. Adding it here keeps the three system properties consistently checked in every test that already validates system properties.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: test/posthog_test.exs
    Line: 115-116
    
    Comment:
    The "ignores set context" test asserts `$lib` and `$lib_version` from `@system_global_properties` but was not updated to also assert `"$is_server": true`. Adding it here keeps the three system properties consistently checked in every test that already validates system properties.
    
    How can I resolve this? If you propose a fix, please make it concise.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
test/posthog_test.exs:115-116
The "ignores set context" test asserts `$lib` and `$lib_version` from `@system_global_properties` but was not updated to also assert `"$is_server": true`. Adding it here keeps the three system properties consistently checked in every test that already validates system properties.

Reviews (1): Last reviewed commit: "feat: emit $is_server property on captur..." | Re-trigger Greptile

@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

posthog-elixir Compliance Report

Date: 2026-06-03 14:55:22 UTC
Duration: 107437ms

⚠️ Some Tests Failed

42/45 tests passed, 3 failed


Capture Tests

29/29 tests passed

View Details
Test Status Duration
Format Validation.Event Has Required Fields 610ms
Format Validation.Event Has Uuid 610ms
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 609ms
Format Validation.Event Has Timestamp 610ms
Retry Behavior.Retries On 503 5616ms
Retry Behavior.Does Not Retry On 400 2612ms
Retry Behavior.Does Not Retry On 401 2613ms
Retry Behavior.Respects Retry After Header 5615ms
Retry Behavior.Implements Backoff 15627ms
Retry Behavior.Retries On 500 5615ms
Retry Behavior.Retries On 502 5617ms
Retry Behavior.Retries On 504 5616ms
Retry Behavior.Max Retries Respected 15626ms
Deduplication.Generates Unique Uuids 621ms
Deduplication.Preserves Uuid On Retry 5616ms
Deduplication.Preserves Uuid And Timestamp On Retry 10621ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry 5617ms
Deduplication.No Duplicate Events In Batch 615ms
Deduplication.Different Events Have Different Uuids 614ms
Compression.Sends Gzip When Enabled 609ms
Batch Format.Uses Proper Batch Structure 610ms
Batch Format.Flush With No Events Sends Nothing 607ms
Batch Format.Multiple Events Batched Together 615ms
Error Handling.Does Not Retry On 403 2613ms
Error Handling.Does Not Retry On 413 2612ms
Error Handling.Retries On 408 5616ms

Feature_Flags Tests

⚠️ 13/16 tests passed, 3 failed

View Details
Test Status Duration
Request Payload.Request With Person Properties Device Id 9ms
Request Payload.Flags Request Uses V2 Query Param 7ms
Request Payload.Flags Request Hits Flags Path Not Decide 8ms
Request Payload.Flags Request Omits Authorization Header 7ms
Request Payload.Token In Flags Body Matches Init 8ms
Request Payload.Groups Round Trip 8ms
Request Payload.Groups Default To Empty Object 8ms
Request Payload.Person Properties Distinct Id Auto Populated When Caller Omits It 7ms
Request Payload.Disable Geoip False Propagates As Geoip Disable False 8ms
Request Payload.Disable Geoip Omitted Defaults To False 7ms
Request Payload.Flag Keys To Evaluate Contains Only Requested Key 8ms
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 12ms
Request Lifecycle.Mock Response Value Is Returned To Caller 7ms
Side Effect Events.Get Feature Flag Captures Feature Flag Called Event 610ms

Failures

request_payload.disable_geoip_omitted_defaults_to_false

Field 'geoip_disable' not found in /flags request body at path 'geoip_disable'. Available keys: ['groups', 'api_key', 'distinct_id', 'flag_keys_to_evaluate', 'group_properties', 'person_properties']

request_lifecycle.mock_response_value_is_returned_to_caller

Last action result missing field 'value'. Keys: ['error', 'success']

side_effect_events.get_feature_flag_captures_feature_flag_called_event

Expected 1 events with name '$feature_flag_called', got 0

Comment thread lib/posthog/config.ex
@turnipdabeets turnipdabeets merged commit 8672156 into main Jun 3, 2026
22 checks passed
@turnipdabeets turnipdabeets deleted the feat/add-is-server-property branch June 3, 2026 17:40
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.

3 participants