Skip to content

fix(flags): keep session properties on minimal flag called events - #1027

Merged
haacked merged 9 commits into
mainfrom
haacked/minimal-flag-called-session-props
Dec 3, 2026
Merged

haacked merged 9 commits into
mainfrom
haacked/minimal-flag-called-session-props

Conversation

@haacked

@haacked haacked commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

💡 Motivation and Context

PostHog sets each session's initial OS, device type and attribution (utm params, referring domain, channel type) from the first event in that session. A property missing from that event is stored as an empty string, and later events in the session don't fill it in. When a team turns on minimal $feature_flag_called events, Android sends a flag call for a flag without an experiment with only a short allowlist of properties. That list didn't include any of these keys. So when a flag call is the first event of a session, that session's initial OS, device type and attribution are blank in session filters, breakdowns and the replay list. A flag call is the first event of 2-3% of Android sessions and up to 15% of Flutter sessions, and Flutter on Android uses this SDK. This blocks making minimal flag call events the default for new organizations.

The list also dropped $raw_user_agent and $timezone, which Android puts on every event. Ingestion hashes those, with $ip, $host and $cookieless_extra, to derive a cookieless event's distinct id and session id, and drops a cookieless event that is missing $raw_user_agent, $ip or $host. The sdk-specs requirement "Minimal event mode for non-experiment flags" (a1c38b6) now says to keep all of them whether or not the event is in cookieless mode.

This PR keeps these on every minimal event: $ip, $raw_user_agent, $host, $timezone, $cookieless_extra, $referring_domain and the utm and click-ID keys from posthog-js MINIMAL_FLAG_CALLED_EVENT_CAMPAIGN_PROPERTIES. main already keeps $geoip_disable and $cookieless_mode. The Android client also keeps the spec's session-initial device and URL properties when the event carries them: $browser, $browser_version, $os, $os_name, $os_version, $device_type, $viewport_width, $viewport_height and $current_url, plus $app_version as static platform identity. Android itself sends $os_name, $os_version, $device_type and $app_version. Ingestion copies $os_name into $os. The full $referrer is still stripped.

The spec says a server SDK strips $current_url and the session-initial device properties, because on a server they come from the request, not the host. posthog-server shares this allowlist through PostHogStateless, so the device keys sit in a client-only set that com.posthog.PostHog adds, and posthog-server strips them. posthog-server doesn't send minimal flag calls today, because its feature flags never report the gate, so that part only takes effect once it does.

💚 How did you test it?

  • The exact key set test for a minimal Android flag call expects the four device keys, and still checks that $app_build and $app_namespace are dropped.
  • A test registers $referring_domain, every campaign key and $referrer as super properties, and checks that each allowlisted key survives and $referrer doesn't.
  • A test gives the Android client a context that attaches $raw_user_agent, $timezone, $host, $cookieless_extra, $user_agent and $locale, and checks that only the first four survive.
  • A test gives the Android client a context that attaches $browser, $browser_version, $os, $viewport_width, $viewport_height and $current_url, and checks that all of them survive.
  • A PostHogStatelessTest test, on the path posthog-server inherits, turns the gate on and passes a caller's values for all ten client-only keys through the context. It checks that all ten are stripped and that $raw_user_agent and $ip stay. It doesn't run in the server module, because posthog-server can't turn the gate on yet.

Each new test failed before its change. :posthog:test, :posthog-server:test and :posthog:apiCheck pass.

📝 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 pnpm changeset to generate a changeset file

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

  • I checked the change against sdk-specs fix: prevent circular reference in the view hierarchy where a child view somehow references back to a parent, creating an infinite loop #281. Its description says the cookieless inputs are kept only in cookieless mode, but the merged spec text keeps them unconditionally, and this PR follows the spec text. The config version 2 attribution category comes from sdk-specs fix: maintain sdk name and version for flutter #162, and Android doesn't send those properties yet, so this PR leaves it alone.
  • Claude Code wrote the failing tests first, then the allowlist change, from a plan that named the properties to keep. A second round added the ingestion inputs and the client-only device keys after sdk-specs a1c38b6.
  • I read the sessions v2 table definition in posthog/posthog to confirm which columns come from a session's first event, and took the campaign key list from posthog-js.
  • The plan said Android sends $os. It sends $os_name, so I kept that key.
  • main already keeps $geoip_disable on minimal events, so this PR leaves it alone.

Keep $os_name, $os_version, $device_type, $app_version, $referring_domain and the utm and click-ID campaign keys that posthog-js keeps. The sessions table takes a session's initial OS, device type and attribution from its first event, and a minimal flag call can be that first event.
@haacked haacked self-assigned this Dec 1, 2026
@haacked
haacked marked this pull request as ready for review December 1, 2026 22:35
@haacked
haacked requested a review from a team as a code owner December 1, 2026 22:35
@veria-ai

veria-ai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

PR overview

No security issues were found in this pull request.

Reviews

@stamphog stamphog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Not approved — this change needs a human reviewer.

Ask for another review through the PostHog MCP or comment @posthog stamp once you have addressed this.

stamphog can't approve this pull request because the prerequisites gate failed: the branch has merge conflicts. The other gates (deny-list, attestation, size and tier) passed, so the conflicts are the only thing blocking it. To move forward, the author should resolve the conflicts with the base branch and push the update, then ask a human reviewer to look at it.

Gate mechanics and policy version
Gate Result
prerequisites ✗ merge conflicts present
deny-list ✓ no deny categories matched
every_file_attested ✓ not a bot PR
size ✓ 39L, 1F substantive, 125L/3F incl. size-exempt files — within ceiling
tier ✓ T1-agent / T1c-medium (125L, 3F, two-areas, fix)
stamphog 2.11.0 .stamphog/policy.yml @ unknown · reviewed head f9f26eb

@stamphog stamphog Bot removed the stamphog label Dec 1, 2026

@posthog posthog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PostHog Review · Standard · reviewed f9f26eb: 1 Should fix.

New pushes to this pull request won't start an automatic review. Comment @posthog review to review new changes.

stamphog[bot]

This comment was marked as outdated.

@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

posthog-android Compliance Report

Date: 2026-12-02T23:10:09.904841+00:00
Duration: 509958ms

✅ All Tests Passed!

243/243 tests passed


Capture_V1 Tests

✅ 111/111 tests passed

View Details
Test Status Duration
Redirects And Library Identity.Follows Same Origin 307 ✅ 2399ms
Redirects And Library Identity.Does Not Follow Cross Origin Redirect ✅ 4030ms
Redirects And Library Identity.Treats 302 As Terminal ✅ 4030ms
Redirects And Library Identity.Follows At Most Five Redirects ✅ 5029ms
Redirects And Library Identity.Sends Lib And Lib Version Per Event ✅ 28ms
Request Size.Batches Close Before Byte Target ✅ 5267ms
Endpoint And Method.Targets V1 Endpoint ✅ 28ms
Endpoint And Method.Does Not Use Legacy Endpoints ✅ 27ms
Required Headers.Has Authorization Bearer Header ✅ 24ms
Required Headers.Has Content Type Json ✅ 24ms
Required Headers.Has Posthog Sdk Info Format ✅ 22ms
Required Headers.Has Posthog Attempt Header ✅ 21ms
Required Headers.Has Posthog Request Id ✅ 23ms
Required Headers.Has Posthog Request Timestamp ✅ 20ms
Required Headers.Has User Agent ✅ 22ms
Body Format.Body Has Created At And Batch ✅ 22ms
Body Format.No Api Key In Body ✅ 21ms
Body Format.No Sent At In Body ✅ 22ms
Event Format.Event Has Required Root Fields ✅ 21ms
Event Format.Event Uuid Is Valid ✅ 26ms
Event Format.Event Timestamp Is Rfc3339 ✅ 25ms
Event Format.Non Utc Event Timestamp Is Converted To Utc ✅ 20ms
Event Format.Distinct Id Is String ✅ 19ms
Event Format.Distinct Id At Root Not Properties ✅ 22ms
Event Format.Custom Properties Preserved ✅ 20ms
Event Format.Set Properties Preserved ✅ 23ms
Event Format.Set Once Properties Preserved ✅ 35ms
Event Format.Groups Properties Preserved ✅ 19ms
Event Format.Sdk Generates Uuid If Not Provided ✅ 25ms
Event Format.Event Has Required Root Fields Batch ✅ 29ms
Event Format.Event Uuid Is Valid Batch ✅ 27ms
Event Format.Event Timestamp Is Rfc3339 Batch ✅ 25ms
Event Format.Distinct Id Is String Batch ✅ 27ms
Event Format.Distinct Id At Root Not Properties Batch ✅ 31ms
Event Format.Custom Properties Preserved Batch ✅ 33ms
Event Format.Set Properties Preserved Batch ✅ 27ms
Event Format.Set Once Properties Preserved Batch ✅ 36ms
Event Format.Groups Properties Preserved Batch ✅ 33ms
Event Format.Sdk Generates Uuid If Not Provided Batch ✅ 26ms
Batch Behavior.Multiple Events In Single Batch ✅ 33ms
Batch Behavior.Batch Envelope Smoke ✅ 32ms
Batch Behavior.Flush With No Events Sends Nothing ✅ 12ms
Batch Behavior.Flush At Triggers Batch ✅ 1022ms
Batch Behavior.Created At Reflects Batch Creation Time ✅ 20ms
Deduplication.Generates Unique Uuids ✅ 36ms
Deduplication.Different Events Same Content Different Uuids ✅ 22ms
Deduplication.Preserves Uuid On Retry ✅ 7018ms
Deduplication.Preserves Timestamp On Retry ✅ 7020ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry ✅ 7019ms
Deduplication.No Duplicate Events In Batch ✅ 33ms
Header Behavior On Retry.Attempt Header Starts At One ✅ 19ms
Header Behavior On Retry.Attempt Header Increments On Retry ✅ 12024ms
Header Behavior On Retry.Request Id Preserved On Retry ✅ 7017ms
Header Behavior On Retry.Different Requests Have Different Request Ids ✅ 2037ms
Header Behavior On Retry.Request Timestamp Changes On Retry ✅ 7015ms
Response Format Validation.Success Response Has Uuid Keyed Results ✅ 18ms
Response Format Validation.Success Response Has Ok For Each Event ✅ 22ms
Response Format Validation.Success No Retry After When All Ok ✅ 24ms
Response Format Validation.Success Retry After Present When Retry Events ✅ 2013ms
Response Format Validation.Success No Retry After When Drop Only ✅ 22ms
Response Format Validation.Response Echoes Request Id ✅ 16ms
Retry Behavior.Retries On 408 ✅ 7015ms
Retry Behavior.Retries On 500 ✅ 7015ms
Retry Behavior.Retries On 503 ✅ 7027ms
Retry Behavior.Retries On 504 ✅ 7014ms
Retry Behavior.Retries On 404 ✅ 6016ms
Retry Behavior.Retries On 429 ✅ 6015ms
Retry Behavior.Retries On 502 ✅ 6016ms
Retry Behavior.Retryable Errors Have Retry After ✅ 4015ms
Retry Behavior.Respects Retry After On Retryable Error ✅ 10026ms
Retry Behavior.Does Not Retry On 400 ✅ 4019ms
Retry Behavior.Does Not Retry On 401 ✅ 4023ms
Retry Behavior.Does Not Retry On 402 ✅ 4023ms
Retry Behavior.Does Not Retry On 413 ✅ 4022ms
Retry Behavior.Does Not Retry On 415 ✅ 4020ms
Retry Behavior.Non Retryable Errors Have No Retry After ✅ 4020ms
Retry Behavior.Implements Backoff ✅ 14031ms
Partial Batch Handling.Handles 200 Full Success ✅ 2019ms
Partial Batch Handling.Handles 200 With All Ok ✅ 3028ms
Partial Batch Handling.Does Not Retry Dropped Events ✅ 3026ms
Partial Batch Handling.Does Not Retry Warning Events ✅ 3025ms
Partial Batch Handling.Prunes Ok Events On Partial Retry ✅ 7017ms
Partial Batch Handling.Prunes Dropped Events On Partial Retry ✅ 7017ms
Partial Batch Handling.Retries Only Retry Events From Partial ✅ 7017ms
Partial Batch Handling.Partial Retry Preserves Uuids ✅ 7018ms
Partial Batch Handling.Partial Retry Attempt Header Increments ✅ 7017ms
Partial Batch Handling.Partial Retry Request Id Preserved ✅ 7017ms
Partial Batch Handling.Respects Retry After On Partial ✅ 7020ms
Partial Batch Handling.Unknown Result Treated As Terminal ✅ 3024ms
Partial Batch Handling.Mixed Ok Drop Warning No Retry ✅ 3030ms
Compression.Sends Gzip Content Encoding ✅ 19ms
Compression.No Content Encoding When Disabled ✅ 18ms
Compression.Compressed Body Is Decompressible ✅ 14ms
Error Handling.Does Not Retry On Unknown 4Xx ✅ 4016ms
Event Options.Cookieless Mode Override ✅ 18ms
Event Options.Disable Skew Correction Override ✅ 15ms
Event Options.Process Person Profile Override ✅ 18ms
Event Options.Product Tour Id Override ✅ 15ms
Event Options.Unset Options Omitted ✅ 15ms
Event Options.Options Override In Batch ✅ 24ms
Event Options.Unknown Option Passes Through ✅ 18ms
Event Options.Option Value Is Not Converted ✅ 17ms
Event Options.Lenient Bool Option Values Are Not Converted ✅ 15ms
Event Options.Option Wins Over Legacy Property ✅ 15ms
Event Options.Legacy Property Fills Unset Option ✅ 17ms
Event Options.Null Option Falls Back To Legacy Property ✅ 15ms
Property Layers.Caller Property Beats Registered Property ✅ 14ms
Property Layers.Before Send Runs Last ✅ 14ms
Fail Open.Empty Api Key Sends Nothing ✅ 3012ms
Fail Open.Personal Api Key Sends Nothing ✅ 3014ms
Geoip And Historical Migration.Historical Migration Absent By Default ✅ 18ms

Capture_Ai_V1 Tests

✅ 115/115 tests passed

View Details
Test Status Duration
Redirects And Library Identity.Follows Same Origin 307 ✅ 2025ms
Redirects And Library Identity.Does Not Follow Cross Origin Redirect ✅ 4018ms
Redirects And Library Identity.Treats 302 As Terminal ✅ 4019ms
Redirects And Library Identity.Follows At Most Five Redirects ✅ 5021ms
Redirects And Library Identity.Sends Lib And Lib Version Per Event ✅ 17ms
Endpoint And Method.Targets V1 Endpoint ✅ 15ms
Endpoint And Method.Does Not Use Legacy Endpoints ✅ 14ms
Endpoint And Method.Capture Does Not Reroute Ai Named Events ✅ 15ms
Endpoint And Method.Capture Ai Does Not Reroute Non Ai Events ✅ 18ms
Lane Isolation.Failing Ai Lane Does Not Delay Analytics ✅ 7026ms
Required Headers.Has Authorization Bearer Header ✅ 19ms
Required Headers.Has Content Type Json ✅ 16ms
Required Headers.Has Posthog Sdk Info Format ✅ 16ms
Required Headers.Has Posthog Attempt Header ✅ 16ms
Required Headers.Has Posthog Request Id ✅ 15ms
Required Headers.Has Posthog Request Timestamp ✅ 16ms
Required Headers.Has User Agent ✅ 16ms
Body Format.Body Has Created At And Batch ✅ 17ms
Body Format.No Api Key In Body ✅ 15ms
Body Format.No Sent At In Body ✅ 17ms
Event Format.Event Has Required Root Fields ✅ 15ms
Event Format.Event Uuid Is Valid ✅ 14ms
Event Format.Event Timestamp Is Rfc3339 ✅ 19ms
Event Format.Non Utc Event Timestamp Is Converted To Utc ✅ 16ms
Event Format.Distinct Id Is String ✅ 15ms
Event Format.Distinct Id At Root Not Properties ✅ 15ms
Event Format.Custom Properties Preserved ✅ 16ms
Event Format.Set Properties Preserved ✅ 16ms
Event Format.Set Once Properties Preserved ✅ 16ms
Event Format.Groups Properties Preserved ✅ 19ms
Event Format.Sdk Generates Uuid If Not Provided ✅ 16ms
Event Format.Event Has Required Root Fields Batch ✅ 26ms
Event Format.Event Uuid Is Valid Batch ✅ 24ms
Event Format.Event Timestamp Is Rfc3339 Batch ✅ 21ms
Event Format.Distinct Id Is String Batch ✅ 33ms
Event Format.Distinct Id At Root Not Properties Batch ✅ 26ms
Event Format.Custom Properties Preserved Batch ✅ 21ms
Event Format.Set Properties Preserved Batch ✅ 19ms
Event Format.Set Once Properties Preserved Batch ✅ 19ms
Event Format.Groups Properties Preserved Batch ✅ 23ms
Event Format.Sdk Generates Uuid If Not Provided Batch ✅ 25ms
Batch Behavior.Multiple Events In Single Batch ✅ 26ms
Batch Behavior.Batch Envelope Smoke ✅ 24ms
Batch Behavior.Flush At Triggers Batch ✅ 1019ms
Batch Behavior.Created At Reflects Batch Creation Time ✅ 17ms
Deduplication.Generates Unique Uuids ✅ 30ms
Deduplication.Different Events Same Content Different Uuids ✅ 24ms
Deduplication.Preserves Uuid On Retry ✅ 7014ms
Deduplication.Preserves Timestamp On Retry ✅ 7016ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry ✅ 7016ms
Deduplication.No Duplicate Events In Batch ✅ 27ms
Header Behavior On Retry.Attempt Header Starts At One ✅ 15ms
Header Behavior On Retry.Attempt Header Increments On Retry ✅ 12015ms
Header Behavior On Retry.Request Id Preserved On Retry ✅ 7015ms
Header Behavior On Retry.Different Requests Have Different Request Ids ✅ 2030ms
Header Behavior On Retry.Request Timestamp Changes On Retry ✅ 7014ms
Response Format Validation.Success Response Has Uuid Keyed Results ✅ 15ms
Response Format Validation.Success Response Has Ok For Each Event ✅ 21ms
Response Format Validation.Success No Retry After When All Ok ✅ 19ms
Response Format Validation.Success Retry After Present When Retry Events ✅ 2009ms
Response Format Validation.Success No Retry After When Drop Only ✅ 19ms
Response Format Validation.Response Echoes Request Id ✅ 15ms
Retry Behavior.Retries On 408 ✅ 7013ms
Retry Behavior.Retries On 500 ✅ 7015ms
Retry Behavior.Retries On 503 ✅ 7021ms
Retry Behavior.Retries On 504 ✅ 7016ms
Retry Behavior.Retries On 404 ✅ 7016ms
Retry Behavior.Retries On 429 ✅ 6014ms
Retry Behavior.Retries On 502 ✅ 7016ms
Retry Behavior.Retryable Errors Have Retry After ✅ 4012ms
Retry Behavior.Respects Retry After On Retryable Error ✅ 10025ms
Retry Behavior.Does Not Retry On 400 ✅ 4018ms
Retry Behavior.Does Not Retry On 401 ✅ 4019ms
Retry Behavior.Does Not Retry On 402 ✅ 4019ms
Retry Behavior.Does Not Retry On 413 ✅ 4018ms
Retry Behavior.Does Not Retry On 415 ✅ 4018ms
Retry Behavior.Non Retryable Errors Have No Retry After ✅ 4019ms
Retry Behavior.Implements Backoff ✅ 14024ms
Partial Batch Handling.Handles 200 Full Success ✅ 2018ms
Partial Batch Handling.Handles 200 With All Ok ✅ 3023ms
Partial Batch Handling.Does Not Retry Dropped Events ✅ 3024ms
Partial Batch Handling.Does Not Retry Warning Events ✅ 3024ms
Partial Batch Handling.Prunes Ok Events On Partial Retry ✅ 7018ms
Partial Batch Handling.Prunes Dropped Events On Partial Retry ✅ 7018ms
Partial Batch Handling.Retries Only Retry Events From Partial ✅ 7016ms
Partial Batch Handling.Partial Retry Preserves Uuids ✅ 7016ms
Partial Batch Handling.Partial Retry Attempt Header Increments ✅ 7017ms
Partial Batch Handling.Partial Retry Request Id Preserved ✅ 7015ms
Partial Batch Handling.Respects Retry After On Partial ✅ 7022ms
Partial Batch Handling.Unknown Result Treated As Terminal ✅ 3022ms
Partial Batch Handling.Mixed Ok Drop Warning No Retry ✅ 3029ms
Compression.Sends Gzip Content Encoding ✅ 16ms
Compression.No Content Encoding When Disabled ✅ 14ms
Compression.Compressed Body Is Decompressible ✅ 14ms
Error Handling.Does Not Retry On Unknown 4Xx ✅ 4015ms
Event Options.Cookieless Mode Override ✅ 16ms
Event Options.Disable Skew Correction Override ✅ 14ms
Event Options.Process Person Profile Override ✅ 15ms
Event Options.Product Tour Id Override ✅ 13ms
Event Options.Unset Options Omitted ✅ 14ms
Event Options.Options Override In Batch ✅ 19ms
Event Options.Unknown Option Passes Through ✅ 14ms
Event Options.Option Value Is Not Converted ✅ 15ms
Event Options.Lenient Bool Option Values Are Not Converted ✅ 16ms
Event Options.Option Wins Over Legacy Property ✅ 20ms
Event Options.Legacy Property Fills Unset Option ✅ 20ms
Event Options.Null Option Falls Back To Legacy Property ✅ 17ms
Event Size.Event Over Ceiling Is Not Sent ✅ 3230ms
Event Size.Over Ceiling Drop Is Reported Or Logged Without Content ✅ 2056ms
Event Size.Batches Close Before Byte Target ✅ 6060ms
Geoip And Historical Migration.Historical Migration Absent By Default ✅ 18ms
Property Layers.Caller Property Beats Registered Property ✅ 16ms
Property Layers.Before Send Runs Last ✅ 14ms
Fail Open.Empty Api Key Sends Nothing ✅ 1011ms
Fail Open.Personal Api Key Sends Nothing ✅ 1010ms

Feature_Flags Tests

✅ 17/17 tests passed

View Details
Test Status Duration
Request Payload.Request With Person Properties Device Id ✅ 32ms
Request Payload.Flags Request Uses V2 Query Param ✅ 20ms
Request Payload.Flags Request Hits Flags Path Not Decide ✅ 18ms
Request Payload.Flags Request Omits Authorization Header ✅ 19ms
Request Payload.Token In Flags Body Matches Init ✅ 15ms
Request Payload.Groups Round Trip ✅ 16ms
Request Payload.Groups Default To Empty Object ✅ 14ms
Request Payload.Disable Geoip False Propagates As Geoip Disable False ✅ 16ms
Request Payload.Disable Geoip Omitted Defaults To False ✅ 14ms
Request Payload.Flag Keys To Evaluate Contains Only Requested Key ✅ 14ms
Request Lifecycle.No Flags Request On Init Alone ✅ 6ms
Request Lifecycle.No Flags Request On Normal Capture ✅ 15ms
Request Lifecycle.Two Flag Calls Produce Two Remote Requests ✅ 24ms
Request Lifecycle.Mock Response Value Is Returned To Caller ✅ 17ms
Retry Behavior.Retries Flags On 502 ✅ 321ms
Retry Behavior.Retries Flags On 504 ✅ 319ms
Side Effect Events.Get Feature Flag Captures Feature Flag Called Event ✅ 23ms

@dustinbyrne dustinbyrne left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AI-assisted review.

Verified that the new and updated tests fail on main and pass on this head, the client path minimizes via PostHog.kt:1455, ingestion copies $os_name → $os, and the added keys fit the sdk-specs "platform identity" and "session-attribution" categories. The campaign list matches posthog-js exactly.

Follow-up: Other client SDKs still blank session-initial device/OS on minimal flag calls. posthog-ios (PostHogSDK.swift:3603-3646) keeps $os_name/$os_version/$app_version but drops $device_type, which it sets in PostHogContext.swift:74. It also keeps only 9 of the 26 campaign keys. posthog-js core's MINIMAL_FLAG_CALLED_EVENT_PROPERTIES (featureFlagUtils.ts:226-264) has no OS or device keys, so React Native, which attaches $os_name/$os_version/$device_type/$app_version, has the same initial-OS and device blanking this PR fixes for Android. Consider aligning both to this list, with tests matching the two in this PR. You could also name the session-read OS and device fields in sdk-specs feature-flag-called-tracker :268. Not a merge condition here.

@stamphog
stamphog Bot dismissed their stale review December 2, 2026 17:01

A new review started for this PR. Its verdict replaces this approval.

stamphog[bot]

This comment was marked as outdated.

@stamphog
stamphog Bot dismissed their stale review December 2, 2026 18:15

A new review started for this PR. Its verdict replaces this approval.

@haacked
haacked enabled auto-merge (squash) December 2, 2026 20:03
@haacked
haacked disabled auto-merge December 2, 2026 20:08

@stamphog stamphog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approved.

The event write-path changes enter risky territory, but the author's trusted STRONG familiarity supplies the policy's assurance path and the diff includes targeted tests. Neither listed review covers the current head; no concrete unresolved substantive concern or other refusal ground is present.

  • Author wrote 75% of the modified lines and has 1 merged PRs in these paths (familiarity STRONG).
Gate mechanics and policy version
Gate Result
prerequisites ✓ all clear
deny-list ✓ no deny categories matched
every_file_attested ✓ not a bot PR
size ✓ 75L, 2F substantive, 357L/5F incl. size-exempt files — within ceiling
tier ✓ T1-agent / T1d-complex (357L, 5F, two-areas, fix)
stamphog 2.11.0 .stamphog/policy.yml @ 4ca94ef · reviewed head 4ca94ef

@haacked
haacked merged commit d08a855 into main Dec 3, 2026
18 checks passed
@haacked
haacked deleted the haacked/minimal-flag-called-session-props branch December 3, 2026 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants