Skip to content

fix(android): make the posthog-android 4.x range strict - #729

Merged
turnipdabeets merged 1 commit into
chore/v6-posthog-ios-4from
fix/v6-android-strict-posthog-android-range
Nov 13, 2026
Merged

turnipdabeets merged 1 commit into
chore/v6-posthog-ios-4from
fix/v6-android-strict-posthog-android-range

Conversation

@turnipdabeets

Copy link
Copy Markdown
Contributor

💡 Motivation and Context

Stacked on #637 (posthog_flutter 6). Same fix as #728 for 5.x, on 6's [4.0.0,5.0.0) range.

A plain Gradle range isn't a ceiling: when anything else in the app asks for a newer posthog-android major, Gradle picks the highest version. The plugin compiles in its own Gradle project against 4.x, so the build succeeds and the app crashes at runtime. #728 confirmed this with posthog_flutter 5.60.2 next to posthog-android 4.0. strictly '[4.0.0,5.0.0)' turns that into a dependency resolution error. It also stops a posthog-android 5.0 from slipping into a 6.x app later.

An app that still declares posthog-android 3.x natively still resolves 4.x here: the strict range wins over its plain version.

Adds one line to .changeset/v6-major-release.md.

💚 How did you test it?

With posthog-android 4.0.0 and core 7.0.0 built from PostHog/posthog-android#871 and published to a scratch Maven repo (the example's repositories change was local only and isn't committed):

  • flutter build apk --debug in example/ builds. dependencyInsight shows com.posthog:posthog-android:{strictly [4.0.0,5.0.0)} -> 4.0.0.
  • :posthog_flutter:testDebugUnitTest passes.

📝 Checklist

  • All commits are signed (see Commit signing)
  • 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 (added a line to the existing v6-major-release.md)

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Claude Code (Claude Opus 5.5) made this alongside #728 after the posthog-android 4.0 wrapper checks. No added test, for the same reason as #728: it's Gradle resolution in a consuming app.

🤖 Generated with Claude Code

A plain range lets Gradle raise posthog-android past 4.x when something else
in the app asks for a newer major, and the plugin, compiled against 4.x, would
crash at runtime instead of failing the build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

posthog-flutter Compliance Report

Date: 2026-11-12T21:12:37.006230+00:00
Duration: 371666ms

✅ All Tests Passed!

232/232 tests passed


Capture_V1 Tests

✅ 105/105 tests passed

View Details
Test Status Duration
Endpoint And Method.Targets V1 Endpoint ✅ 213ms
Endpoint And Method.Does Not Use Legacy Endpoints ✅ 128ms
Required Headers.Has Authorization Bearer Header ✅ 123ms
Required Headers.Has Content Type Json ✅ 127ms
Required Headers.Has Posthog Sdk Info Format ✅ 123ms
Required Headers.Has Posthog Attempt Header ✅ 120ms
Required Headers.Has Posthog Request Id ✅ 121ms
Required Headers.Has Posthog Request Timestamp ✅ 121ms
Required Headers.Has User Agent ✅ 123ms
Body Format.Body Has Created At And Batch ✅ 120ms
Body Format.No Api Key In Body ✅ 121ms
Body Format.No Sent At In Body ✅ 120ms
Event Format.Event Has Required Root Fields ✅ 121ms
Event Format.Event Uuid Is Valid ✅ 121ms
Event Format.Event Timestamp Is Rfc3339 ✅ 121ms
Event Format.Non Utc Event Timestamp Is Converted To Utc ✅ 119ms
Event Format.Distinct Id Is String ✅ 123ms
Event Format.Distinct Id At Root Not Properties ✅ 121ms
Event Format.Custom Properties Preserved ✅ 122ms
Event Format.Set Properties Preserved ✅ 121ms
Event Format.Set Once Properties Preserved ✅ 120ms
Event Format.Groups Properties Preserved ✅ 119ms
Event Format.Sdk Generates Uuid If Not Provided ✅ 120ms
Event Format.Event Has Required Root Fields Batch ✅ 125ms
Event Format.Event Uuid Is Valid Batch ✅ 126ms
Event Format.Event Timestamp Is Rfc3339 Batch ✅ 125ms
Event Format.Distinct Id Is String Batch ✅ 125ms
Event Format.Distinct Id At Root Not Properties Batch ✅ 126ms
Event Format.Custom Properties Preserved Batch ✅ 125ms
Event Format.Set Properties Preserved Batch ✅ 129ms
Event Format.Set Once Properties Preserved Batch ✅ 126ms
Event Format.Groups Properties Preserved Batch ✅ 125ms
Event Format.Sdk Generates Uuid If Not Provided Batch ✅ 125ms
Batch Behavior.Multiple Events In Single Batch ✅ 132ms
Batch Behavior.Batch Envelope Smoke ✅ 127ms
Batch Behavior.Flush With No Events Sends Nothing ✅ 110ms
Batch Behavior.Flush At Triggers Batch ✅ 1017ms
Batch Behavior.Created At Reflects Batch Creation Time ✅ 122ms
Deduplication.Generates Unique Uuids ✅ 130ms
Deduplication.Different Events Same Content Different Uuids ✅ 123ms
Deduplication.Preserves Uuid On Retry ✅ 5129ms
Deduplication.Preserves Timestamp On Retry ✅ 5126ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry ✅ 5129ms
Deduplication.No Duplicate Events In Batch ✅ 131ms
Header Behavior On Retry.Attempt Header Starts At One ✅ 117ms
Header Behavior On Retry.Attempt Header Increments On Retry ✅ 10125ms
Header Behavior On Retry.Request Id Preserved On Retry ✅ 5126ms
Header Behavior On Retry.Different Requests Have Different Request Ids ✅ 2233ms
Header Behavior On Retry.Request Timestamp Changes On Retry ✅ 5124ms
Response Format Validation.Success Response Has Uuid Keyed Results ✅ 118ms
Response Format Validation.Success Response Has Ok For Each Event ✅ 124ms
Response Format Validation.Success No Retry After When All Ok ✅ 121ms
Response Format Validation.Success Retry After Present When Retry Events ✅ 122ms
Response Format Validation.Success No Retry After When Drop Only ✅ 123ms
Response Format Validation.Response Echoes Request Id ✅ 118ms
Retry Behavior.Retries On 408 ✅ 5123ms
Retry Behavior.Retries On 500 ✅ 5124ms
Retry Behavior.Retries On 503 ✅ 5118ms
Retry Behavior.Retries On 504 ✅ 5124ms
Retry Behavior.Retries On 404 ✅ 5128ms
Retry Behavior.Retries On 429 ✅ 5124ms
Retry Behavior.Retries On 502 ✅ 5124ms
Retry Behavior.Retryable Errors Have Retry After ✅ 2122ms
Retry Behavior.Respects Retry After On Retryable Error ✅ 8126ms
Retry Behavior.Does Not Retry On 400 ✅ 2122ms
Retry Behavior.Does Not Retry On 401 ✅ 2121ms
Retry Behavior.Does Not Retry On 402 ✅ 2120ms
Retry Behavior.Does Not Retry On 413 ✅ 2121ms
Retry Behavior.Does Not Retry On 415 ✅ 2121ms
Retry Behavior.Non Retryable Errors Have No Retry After ✅ 2121ms
Retry Behavior.Implements Backoff ✅ 12130ms
Partial Batch Handling.Handles 200 Full Success ✅ 2121ms
Partial Batch Handling.Handles 200 With All Ok ✅ 3128ms
Partial Batch Handling.Does Not Retry Dropped Events ✅ 3126ms
Partial Batch Handling.Does Not Retry Warning Events ✅ 3123ms
Partial Batch Handling.Prunes Ok Events On Partial Retry ✅ 5127ms
Partial Batch Handling.Prunes Dropped Events On Partial Retry ✅ 5128ms
Partial Batch Handling.Retries Only Retry Events From Partial ✅ 5130ms
Partial Batch Handling.Partial Retry Preserves Uuids ✅ 5127ms
Partial Batch Handling.Partial Retry Attempt Header Increments ✅ 5127ms
Partial Batch Handling.Partial Retry Request Id Preserved ✅ 5127ms
Partial Batch Handling.Respects Retry After On Partial ✅ 5126ms
Partial Batch Handling.Unknown Result Treated As Terminal ✅ 3126ms
Partial Batch Handling.Mixed Ok Drop Warning No Retry ✅ 3133ms
Compression.Sends Gzip Content Encoding ✅ 120ms
Compression.No Content Encoding When Disabled ✅ 116ms
Compression.Compressed Body Is Decompressible ✅ 117ms
Error Handling.Does Not Retry On Unknown 4Xx ✅ 2119ms
Event Options.Cookieless Mode Override ✅ 119ms
Event Options.Disable Skew Correction Override ✅ 118ms
Event Options.Process Person Profile Override ✅ 117ms
Event Options.Product Tour Id Override ✅ 118ms
Event Options.Unset Options Omitted ✅ 118ms
Event Options.Options Override In Batch ✅ 121ms
Event Options.Unknown Option Passes Through ✅ 117ms
Event Options.Option Value Is Not Converted ✅ 116ms
Event Options.Lenient Bool Option Values Are Not Converted ✅ 117ms
Event Options.Option Wins Over Legacy Property ✅ 117ms
Event Options.Legacy Property Fills Unset Option ✅ 117ms
Event Options.Null Option Falls Back To Legacy Property ✅ 116ms
Property Layers.Caller Property Beats Registered Property ✅ 118ms
Property Layers.Before Send Runs Last ✅ 117ms
Fail Open.Empty Api Key Sends Nothing ✅ 1111ms
Fail Open.Personal Api Key Sends Nothing ✅ 1111ms
Geoip And Historical Migration.Historical Migration Absent By Default ✅ 117ms

Capture_Ai_V1 Tests

✅ 110/110 tests passed

View Details
Test Status Duration
Endpoint And Method.Targets V1 Endpoint ✅ 119ms
Endpoint And Method.Does Not Use Legacy Endpoints ✅ 116ms
Endpoint And Method.Capture Does Not Reroute Ai Named Events ✅ 117ms
Endpoint And Method.Capture Ai Does Not Reroute Non Ai Events ✅ 117ms
Lane Isolation.Failing Ai Lane Does Not Delay Analytics ✅ 5132ms
Required Headers.Has Authorization Bearer Header ✅ 117ms
Required Headers.Has Content Type Json ✅ 117ms
Required Headers.Has Posthog Sdk Info Format ✅ 118ms
Required Headers.Has Posthog Attempt Header ✅ 116ms
Required Headers.Has Posthog Request Id ✅ 116ms
Required Headers.Has Posthog Request Timestamp ✅ 117ms
Required Headers.Has User Agent ✅ 116ms
Body Format.Body Has Created At And Batch ✅ 117ms
Body Format.No Api Key In Body ✅ 116ms
Body Format.No Sent At In Body ✅ 116ms
Event Format.Event Has Required Root Fields ✅ 116ms
Event Format.Event Uuid Is Valid ✅ 117ms
Event Format.Event Timestamp Is Rfc3339 ✅ 117ms
Event Format.Non Utc Event Timestamp Is Converted To Utc ✅ 117ms
Event Format.Distinct Id Is String ✅ 118ms
Event Format.Distinct Id At Root Not Properties ✅ 117ms
Event Format.Custom Properties Preserved ✅ 117ms
Event Format.Set Properties Preserved ✅ 117ms
Event Format.Set Once Properties Preserved ✅ 116ms
Event Format.Groups Properties Preserved ✅ 118ms
Event Format.Sdk Generates Uuid If Not Provided ✅ 115ms
Event Format.Event Has Required Root Fields Batch ✅ 121ms
Event Format.Event Uuid Is Valid Batch ✅ 121ms
Event Format.Event Timestamp Is Rfc3339 Batch ✅ 121ms
Event Format.Distinct Id Is String Batch ✅ 122ms
Event Format.Distinct Id At Root Not Properties Batch ✅ 122ms
Event Format.Custom Properties Preserved Batch ✅ 121ms
Event Format.Set Properties Preserved Batch ✅ 121ms
Event Format.Set Once Properties Preserved Batch ✅ 121ms
Event Format.Groups Properties Preserved Batch ✅ 121ms
Event Format.Sdk Generates Uuid If Not Provided Batch ✅ 121ms
Batch Behavior.Multiple Events In Single Batch ✅ 126ms
Batch Behavior.Batch Envelope Smoke ✅ 125ms
Batch Behavior.Flush At Triggers Batch ✅ 1016ms
Batch Behavior.Created At Reflects Batch Creation Time ✅ 117ms
Deduplication.Generates Unique Uuids ✅ 127ms
Deduplication.Different Events Same Content Different Uuids ✅ 119ms
Deduplication.Preserves Uuid On Retry ✅ 5122ms
Deduplication.Preserves Timestamp On Retry ✅ 5124ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry ✅ 5128ms
Deduplication.No Duplicate Events In Batch ✅ 129ms
Header Behavior On Retry.Attempt Header Starts At One ✅ 118ms
Header Behavior On Retry.Attempt Header Increments On Retry ✅ 10128ms
Header Behavior On Retry.Request Id Preserved On Retry ✅ 5123ms
Header Behavior On Retry.Different Requests Have Different Request Ids ✅ 2232ms
Header Behavior On Retry.Request Timestamp Changes On Retry ✅ 5121ms
Response Format Validation.Success Response Has Uuid Keyed Results ✅ 116ms
Response Format Validation.Success Response Has Ok For Each Event ✅ 122ms
Response Format Validation.Success No Retry After When All Ok ✅ 120ms
Response Format Validation.Success Retry After Present When Retry Events ✅ 120ms
Response Format Validation.Success No Retry After When Drop Only ✅ 121ms
Response Format Validation.Response Echoes Request Id ✅ 115ms
Retry Behavior.Retries On 408 ✅ 5119ms
Retry Behavior.Retries On 500 ✅ 5122ms
Retry Behavior.Retries On 503 ✅ 5124ms
Retry Behavior.Retries On 504 ✅ 5124ms
Retry Behavior.Retries On 404 ✅ 5122ms
Retry Behavior.Retries On 429 ✅ 5123ms
Retry Behavior.Retries On 502 ✅ 5123ms
Retry Behavior.Retryable Errors Have Retry After ✅ 2119ms
Retry Behavior.Respects Retry After On Retryable Error ✅ 8123ms
Retry Behavior.Does Not Retry On 400 ✅ 2121ms
Retry Behavior.Does Not Retry On 401 ✅ 2120ms
Retry Behavior.Does Not Retry On 402 ✅ 2120ms
Retry Behavior.Does Not Retry On 413 ✅ 2120ms
Retry Behavior.Does Not Retry On 415 ✅ 2120ms
Retry Behavior.Non Retryable Errors Have No Retry After ✅ 2120ms
Retry Behavior.Implements Backoff ✅ 12128ms
Partial Batch Handling.Handles 200 Full Success ✅ 2118ms
Partial Batch Handling.Handles 200 With All Ok ✅ 3126ms
Partial Batch Handling.Does Not Retry Dropped Events ✅ 3122ms
Partial Batch Handling.Does Not Retry Warning Events ✅ 3122ms
Partial Batch Handling.Prunes Ok Events On Partial Retry ✅ 5126ms
Partial Batch Handling.Prunes Dropped Events On Partial Retry ✅ 5126ms
Partial Batch Handling.Retries Only Retry Events From Partial ✅ 5126ms
Partial Batch Handling.Partial Retry Preserves Uuids ✅ 5125ms
Partial Batch Handling.Partial Retry Attempt Header Increments ✅ 5125ms
Partial Batch Handling.Partial Retry Request Id Preserved ✅ 5125ms
Partial Batch Handling.Respects Retry After On Partial ✅ 5125ms
Partial Batch Handling.Unknown Result Treated As Terminal ✅ 3124ms
Partial Batch Handling.Mixed Ok Drop Warning No Retry ✅ 3129ms
Compression.Sends Gzip Content Encoding ✅ 117ms
Compression.No Content Encoding When Disabled ✅ 116ms
Compression.Compressed Body Is Decompressible ✅ 116ms
Error Handling.Does Not Retry On Unknown 4Xx ✅ 2118ms
Event Options.Cookieless Mode Override ✅ 117ms
Event Options.Disable Skew Correction Override ✅ 116ms
Event Options.Process Person Profile Override ✅ 116ms
Event Options.Product Tour Id Override ✅ 117ms
Event Options.Unset Options Omitted ✅ 116ms
Event Options.Options Override In Batch ✅ 121ms
Event Options.Unknown Option Passes Through ✅ 117ms
Event Options.Option Value Is Not Converted ✅ 116ms
Event Options.Lenient Bool Option Values Are Not Converted ✅ 116ms
Event Options.Option Wins Over Legacy Property ✅ 118ms
Event Options.Legacy Property Fills Unset Option ✅ 116ms
Event Options.Null Option Falls Back To Legacy Property ✅ 116ms
Event Size.Event Over Ceiling Is Not Sent ✅ 4482ms
Event Size.Over Ceiling Drop Is Reported Or Logged Without Content ✅ 2197ms
Event Size.Batches Close Before Byte Target ✅ 6579ms
Geoip And Historical Migration.Historical Migration Absent By Default ✅ 118ms
Property Layers.Caller Property Beats Registered Property ✅ 116ms
Property Layers.Before Send Runs Last ✅ 115ms
Fail Open.Empty Api Key Sends Nothing ✅ 1113ms
Fail Open.Personal Api Key Sends Nothing ✅ 1110ms

Feature_Flags Tests

✅ 17/17 tests passed

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

@turnipdabeets
turnipdabeets marked this pull request as ready for review November 12, 2026 23:08
@turnipdabeets
turnipdabeets requested a review from a team as a code owner November 12, 2026 23:08
@veria-ai

veria-ai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

PR overview

No security issues were found in this pull request.

Reviews

@turnipdabeets turnipdabeets added the stamphog Ask Stamphog to review this pull request label Nov 13, 2026

@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 disclosed dependency and build changes enter risky territory, but current-head reviewer assurance and STRONG author familiarity cover the change. No unresolved substantive concerns or other refusal grounds were found.

  • Author wrote 100% of the modified lines and has 30 merged PRs in these paths (familiarity STRONG).
  • PostHog Review (Standard) reviewed the current head: no findings.
Gate mechanics and policy version
Gate Result
prerequisites ✓ all clear
deny-list ✓ no deny categories matched
size ✓ 6L, 1F substantive, 7L/2F incl. docs/generated/snapshots — within ceiling
tier ✓ T1-agent / T1b-small (7L, 2F, two-areas, fix)
stamphog 2.8.0 .stamphog/policy.yml @ 5d52818 · reviewed head 5d52818

@turnipdabeets
turnipdabeets merged commit dac31bf into chore/v6-posthog-ios-4 Nov 13, 2026
20 of 23 checks passed
@turnipdabeets
turnipdabeets deleted the fix/v6-android-strict-posthog-android-range branch November 13, 2026 17:58
@turnipdabeets turnipdabeets mentioned this pull request Nov 13, 2026
6 of 17 tasks
turnipdabeets added a commit that referenced this pull request Nov 13, 2026
Keeps this branch's restructured MIGRATION.md and changeset, and carries
over what changed on #637 since the last merge:
- #730: a registered process_person_profile no longer applies to
  identity events, so "Fix identity calls" becomes "Check registered
  person processing" and the identify example goes away
- #729: Android build fails instead of crashing past posthog-android 4.x
- e1178f8: iOS add-to-app modules work on Flutter 3.50.0
- 862cdd3: capture v1 link points at /docs/api/capture-v1

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stamphog Ask Stamphog to review this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants