Skip to content

fix: release review follow-ups for posthog-android 4.0 - #976

Merged
turnipdabeets merged 3 commits into
chore/v4-remove-deprecatedfrom
fix/v4-release-review-followups
Nov 12, 2026
Merged

turnipdabeets merged 3 commits into
chore/v4-remove-deprecatedfrom
fix/v4-release-review-followups

Conversation

@turnipdabeets

@turnipdabeets turnipdabeets commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

💡 Motivation and Context

Stacked on #871. Three problems found in a release review of the 4.0 branch.

The migration guide page on posthog.com would stay stale. bin/docs_scripts/generate_markdown.py built references/posthog-android-migration.md from docs/migration-*.md. The 4.0 guide moved to MIGRATION.md, so no file matched and the release kept the old generated page. That page was 116 lines behind MIGRATION.md and linked /docs/libraries/capture-v1, which PostHog/posthog.com#21385 removes. PostHog/posthog.com#22061, which #21385 is stacked on, turns /docs/libraries/android into the generated reference and adds this page to the nav as the Android migration guide, so it's the upgrade guide users will read. The generator now reads MIGRATION.md, drops its # Migration guide title (the front matter supplies one) and the page is regenerated. Its body is identical to MIGRATION.md.

The guide was wrong about mixing versions after #974. It said posthog-server 2.25 next to posthog-android 3.x fails at runtime. With #974's constraint, Gradle resolves posthog-android 4.0 instead. The "Requirements and versions" paragraph, the posthog-server section and the server changeset now say that. The paragraph also says a library compiled against 3.x still fails at runtime: a Flutter app on posthog_flutter 5.60.2 plus core 7 builds, because the plugin compiles in its own Gradle project against 3.x, and then calls removed APIs (PostHogOnFeatureFlags, RRStyle).

Two personless dedup tests stopped testing anything after the main merge. Since #967 the person properties hash is stored only once an event is queued. PostHogCaptureOptionsTest's default beforeSend drops every event, so no hash was ever stored, and the tests passed with personless detection switched off. They now queue events to a mock server.

Also fixes a flaky PostHogCaptureV1Test case: the HTTP-date Retry-After test compared against the real clock, and read 19 instead of 20 whenever the request crossed a second boundary.

💚 How did you test it?

  • Generator: ran the migration step locally. The page body matches MIGRATION.md line for line. MIGRATION.md has no repo-relative links, so they all work on posthog.com.

  • Version mixing: published core 7.0.0, posthog-android 4.0.0 and posthog-server 2.25.0 from feat!: posthog-android 4.0 and posthog 7.0 #871's head to a scratch Maven repo, then resolved a throwaway AGP 8.9.1 app:

    Consumer declares Resolves to
    posthog-android:3.76.2 + posthog-server:2.25.0 posthog-android 4.0.0
    posthog-android:[3.75.0,4.0.0) + posthog:7.0.0 posthog-android 4.0.0
    posthog-android:3.76.2 only unchanged
  • Tests: with personless detection switched off (surelyProcessesPersonProfile returning true and the queued check ignoring process_person_profile), the two tests now fail, 2 of 18. Before this change they passed. With the code restored, PostHogCaptureOptionsTest and PostHogCaptureV1Test pass, and spotlessCheck passes. The full :posthog:test run's only failure was the Retry-After flake this PR fixes.

📝 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

  • No new changeset: docs and tests only. Edited the existing .changeset/server-keep-on-feature-flags.md entry.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Claude Code (Opus 5.5) found these in a release review of #871 and made the fixes. I pointed the generator at MIGRATION.md instead of moving the guide back to docs/, because the changesets, README and the docs PRs link MIGRATION.md. The generator change only touches the migration step, so regenerating it didn't need Dokka or rewrite the 3.x reference.

🤖 Generated with Claude Code

turnipdabeets and others added 3 commits November 12, 2026 14:44
The reference generator read docs/migration-*.md, which the 4.0 branch no
longer has since the guide moved to MIGRATION.md, so a release kept the old
generated page. That page now becomes the Android migration guide on
posthog.com, so read MIGRATION.md and regenerate it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since the core-to-android constraint, core 7.0 or posthog-server 2.25 next
to posthog-android 3.x resolves posthog-android 4.0 instead of failing at
runtime.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… flake

The two personless dedup tests dropped every event in beforeSend, so no hash
was ever stored and they passed with personless detection switched off. They
now queue events to a mock server, and fail under that mutation.

The HTTP-date Retry-After test compared against the real clock, so it read
19 instead of 20 when the request crossed a second boundary.

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

Copy link
Copy Markdown
Contributor

posthog-android Compliance Report

Date: 2026-11-12T19:56:43.970564+00:00
Duration: 473947ms

✅ 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 ✅ 270ms
Endpoint And Method.Does Not Use Legacy Endpoints ✅ 24ms
Required Headers.Has Authorization Bearer Header ✅ 22ms
Required Headers.Has Content Type Json ✅ 18ms
Required Headers.Has Posthog Sdk Info Format ✅ 15ms
Required Headers.Has Posthog Attempt Header ✅ 17ms
Required Headers.Has Posthog Request Id ✅ 16ms
Required Headers.Has Posthog Request Timestamp ✅ 15ms
Required Headers.Has User Agent ✅ 16ms
Body Format.Body Has Created At And Batch ✅ 14ms
Body Format.No Api Key In Body ✅ 13ms
Body Format.No Sent At In Body ✅ 15ms
Event Format.Event Has Required Root Fields ✅ 15ms
Event Format.Event Uuid Is Valid ✅ 16ms
Event Format.Event Timestamp Is Rfc3339 ✅ 16ms
Event Format.Non Utc Event Timestamp Is Converted To Utc ✅ 20ms
Event Format.Distinct Id Is String ✅ 14ms
Event Format.Distinct Id At Root Not Properties ✅ 16ms
Event Format.Custom Properties Preserved ✅ 16ms
Event Format.Set Properties Preserved ✅ 18ms
Event Format.Set Once Properties Preserved ✅ 18ms
Event Format.Groups Properties Preserved ✅ 13ms
Event Format.Sdk Generates Uuid If Not Provided ✅ 16ms
Event Format.Event Has Required Root Fields Batch ✅ 20ms
Event Format.Event Uuid Is Valid Batch ✅ 18ms
Event Format.Event Timestamp Is Rfc3339 Batch ✅ 21ms
Event Format.Distinct Id Is String Batch ✅ 16ms
Event Format.Distinct Id At Root Not Properties Batch ✅ 18ms
Event Format.Custom Properties Preserved Batch ✅ 17ms
Event Format.Set Properties Preserved Batch ✅ 18ms
Event Format.Set Once Properties Preserved Batch ✅ 19ms
Event Format.Groups Properties Preserved Batch ✅ 17ms
Event Format.Sdk Generates Uuid If Not Provided Batch ✅ 27ms
Batch Behavior.Multiple Events In Single Batch ✅ 26ms
Batch Behavior.Batch Envelope Smoke ✅ 21ms
Batch Behavior.Flush With No Events Sends Nothing ✅ 10ms
Batch Behavior.Flush At Triggers Batch ✅ 1018ms
Batch Behavior.Created At Reflects Batch Creation Time ✅ 17ms
Deduplication.Generates Unique Uuids ✅ 24ms
Deduplication.Different Events Same Content Different Uuids ✅ 17ms
Deduplication.Preserves Uuid On Retry ✅ 7012ms
Deduplication.Preserves Timestamp On Retry ✅ 7016ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry ✅ 7021ms
Deduplication.No Duplicate Events In Batch ✅ 23ms
Header Behavior On Retry.Attempt Header Starts At One ✅ 11ms
Header Behavior On Retry.Attempt Header Increments On Retry ✅ 12019ms
Header Behavior On Retry.Request Id Preserved On Retry ✅ 7014ms
Header Behavior On Retry.Different Requests Have Different Request Ids ✅ 2024ms
Header Behavior On Retry.Request Timestamp Changes On Retry ✅ 7015ms
Response Format Validation.Success Response Has Uuid Keyed Results ✅ 14ms
Response Format Validation.Success Response Has Ok For Each Event ✅ 19ms
Response Format Validation.Success No Retry After When All Ok ✅ 16ms
Response Format Validation.Success Retry After Present When Retry Events ✅ 2009ms
Response Format Validation.Success No Retry After When Drop Only ✅ 15ms
Response Format Validation.Response Echoes Request Id ✅ 12ms
Retry Behavior.Retries On 408 ✅ 7012ms
Retry Behavior.Retries On 500 ✅ 7015ms
Retry Behavior.Retries On 503 ✅ 7015ms
Retry Behavior.Retries On 504 ✅ 7011ms
Retry Behavior.Retries On 404 ✅ 7013ms
Retry Behavior.Retries On 429 ✅ 7015ms
Retry Behavior.Retries On 502 ✅ 6012ms
Retry Behavior.Retryable Errors Have Retry After ✅ 4012ms
Retry Behavior.Respects Retry After On Retryable Error ✅ 10022ms
Retry Behavior.Does Not Retry On 400 ✅ 4018ms
Retry Behavior.Does Not Retry On 401 ✅ 4015ms
Retry Behavior.Does Not Retry On 402 ✅ 4016ms
Retry Behavior.Does Not Retry On 413 ✅ 4017ms
Retry Behavior.Does Not Retry On 415 ✅ 4018ms
Retry Behavior.Non Retryable Errors Have No Retry After ✅ 4017ms
Retry Behavior.Implements Backoff ✅ 14026ms
Partial Batch Handling.Handles 200 Full Success ✅ 2016ms
Partial Batch Handling.Handles 200 With All Ok ✅ 3021ms
Partial Batch Handling.Does Not Retry Dropped Events ✅ 3019ms
Partial Batch Handling.Does Not Retry Warning Events ✅ 3019ms
Partial Batch Handling.Prunes Ok Events On Partial Retry ✅ 7014ms
Partial Batch Handling.Prunes Dropped Events On Partial Retry ✅ 7020ms
Partial Batch Handling.Retries Only Retry Events From Partial ✅ 7015ms
Partial Batch Handling.Partial Retry Preserves Uuids ✅ 7014ms
Partial Batch Handling.Partial Retry Attempt Header Increments ✅ 7015ms
Partial Batch Handling.Partial Retry Request Id Preserved ✅ 7016ms
Partial Batch Handling.Respects Retry After On Partial ✅ 7021ms
Partial Batch Handling.Unknown Result Treated As Terminal ✅ 3019ms
Partial Batch Handling.Mixed Ok Drop Warning No Retry ✅ 3023ms
Compression.Sends Gzip Content Encoding ✅ 12ms
Compression.No Content Encoding When Disabled ✅ 9ms
Compression.Compressed Body Is Decompressible ✅ 10ms
Error Handling.Does Not Retry On Unknown 4Xx ✅ 4013ms
Event Options.Cookieless Mode Override ✅ 13ms
Event Options.Disable Skew Correction Override ✅ 10ms
Event Options.Process Person Profile Override ✅ 14ms
Event Options.Product Tour Id Override ✅ 15ms
Event Options.Unset Options Omitted ✅ 15ms
Event Options.Options Override In Batch ✅ 16ms
Event Options.Unknown Option Passes Through ✅ 16ms
Event Options.Option Value Is Not Converted ✅ 14ms
Event Options.Lenient Bool Option Values Are Not Converted ✅ 12ms
Event Options.Option Wins Over Legacy Property ✅ 10ms
Event Options.Legacy Property Fills Unset Option ✅ 12ms
Event Options.Null Option Falls Back To Legacy Property ✅ 14ms
Property Layers.Caller Property Beats Registered Property ✅ 12ms
Property Layers.Before Send Runs Last ✅ 14ms
Fail Open.Empty Api Key Sends Nothing ✅ 3011ms
Fail Open.Personal Api Key Sends Nothing ✅ 3010ms
Geoip And Historical Migration.Historical Migration Absent By Default ✅ 13ms

Capture_Ai_V1 Tests

✅ 110/110 tests passed

View Details
Test Status Duration
Endpoint And Method.Targets V1 Endpoint ✅ 14ms
Endpoint And Method.Does Not Use Legacy Endpoints ✅ 11ms
Endpoint And Method.Capture Does Not Reroute Ai Named Events ✅ 11ms
Endpoint And Method.Capture Ai Does Not Reroute Non Ai Events ✅ 13ms
Lane Isolation.Failing Ai Lane Does Not Delay Analytics ✅ 7018ms
Required Headers.Has Authorization Bearer Header ✅ 14ms
Required Headers.Has Content Type Json ✅ 15ms
Required Headers.Has Posthog Sdk Info Format ✅ 12ms
Required Headers.Has Posthog Attempt Header ✅ 12ms
Required Headers.Has Posthog Request Id ✅ 11ms
Required Headers.Has Posthog Request Timestamp ✅ 11ms
Required Headers.Has User Agent ✅ 13ms
Body Format.Body Has Created At And Batch ✅ 13ms
Body Format.No Api Key In Body ✅ 11ms
Body Format.No Sent At In Body ✅ 11ms
Event Format.Event Has Required Root Fields ✅ 11ms
Event Format.Event Uuid Is Valid ✅ 12ms
Event Format.Event Timestamp Is Rfc3339 ✅ 10ms
Event Format.Non Utc Event Timestamp Is Converted To Utc ✅ 11ms
Event Format.Distinct Id Is String ✅ 13ms
Event Format.Distinct Id At Root Not Properties ✅ 11ms
Event Format.Custom Properties Preserved ✅ 13ms
Event Format.Set Properties Preserved ✅ 12ms
Event Format.Set Once Properties Preserved ✅ 12ms
Event Format.Groups Properties Preserved ✅ 14ms
Event Format.Sdk Generates Uuid If Not Provided ✅ 11ms
Event Format.Event Has Required Root Fields Batch ✅ 14ms
Event Format.Event Uuid Is Valid Batch ✅ 14ms
Event Format.Event Timestamp Is Rfc3339 Batch ✅ 13ms
Event Format.Distinct Id Is String Batch ✅ 13ms
Event Format.Distinct Id At Root Not Properties Batch ✅ 15ms
Event Format.Custom Properties Preserved Batch ✅ 15ms
Event Format.Set Properties Preserved Batch ✅ 16ms
Event Format.Set Once Properties Preserved Batch ✅ 19ms
Event Format.Groups Properties Preserved Batch ✅ 17ms
Event Format.Sdk Generates Uuid If Not Provided Batch ✅ 18ms
Batch Behavior.Multiple Events In Single Batch ✅ 19ms
Batch Behavior.Batch Envelope Smoke ✅ 15ms
Batch Behavior.Flush At Triggers Batch ✅ 1018ms
Batch Behavior.Created At Reflects Batch Creation Time ✅ 14ms
Deduplication.Generates Unique Uuids ✅ 23ms
Deduplication.Different Events Same Content Different Uuids ✅ 12ms
Deduplication.Preserves Uuid On Retry ✅ 7013ms
Deduplication.Preserves Timestamp On Retry ✅ 7013ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry ✅ 7023ms
Deduplication.No Duplicate Events In Batch ✅ 21ms
Header Behavior On Retry.Attempt Header Starts At One ✅ 10ms
Header Behavior On Retry.Attempt Header Increments On Retry ✅ 12025ms
Header Behavior On Retry.Request Id Preserved On Retry ✅ 7013ms
Header Behavior On Retry.Different Requests Have Different Request Ids ✅ 2022ms
Header Behavior On Retry.Request Timestamp Changes On Retry ✅ 7015ms
Response Format Validation.Success Response Has Uuid Keyed Results ✅ 14ms
Response Format Validation.Success Response Has Ok For Each Event ✅ 17ms
Response Format Validation.Success No Retry After When All Ok ✅ 15ms
Response Format Validation.Success Retry After Present When Retry Events ✅ 2008ms
Response Format Validation.Success No Retry After When Drop Only ✅ 15ms
Response Format Validation.Response Echoes Request Id ✅ 10ms
Retry Behavior.Retries On 408 ✅ 7013ms
Retry Behavior.Retries On 500 ✅ 7013ms
Retry Behavior.Retries On 503 ✅ 7025ms
Retry Behavior.Retries On 504 ✅ 7011ms
Retry Behavior.Retries On 404 ✅ 6012ms
Retry Behavior.Retries On 429 ✅ 7013ms
Retry Behavior.Retries On 502 ✅ 6014ms
Retry Behavior.Retryable Errors Have Retry After ✅ 4010ms
Retry Behavior.Respects Retry After On Retryable Error ✅ 10015ms
Retry Behavior.Does Not Retry On 400 ✅ 4013ms
Retry Behavior.Does Not Retry On 401 ✅ 4014ms
Retry Behavior.Does Not Retry On 402 ✅ 4013ms
Retry Behavior.Does Not Retry On 413 ✅ 4014ms
Retry Behavior.Does Not Retry On 415 ✅ 4013ms
Retry Behavior.Non Retryable Errors Have No Retry After ✅ 4013ms
Retry Behavior.Implements Backoff ✅ 14015ms
Partial Batch Handling.Handles 200 Full Success ✅ 2014ms
Partial Batch Handling.Handles 200 With All Ok ✅ 3018ms
Partial Batch Handling.Does Not Retry Dropped Events ✅ 3019ms
Partial Batch Handling.Does Not Retry Warning Events ✅ 3018ms
Partial Batch Handling.Prunes Ok Events On Partial Retry ✅ 7015ms
Partial Batch Handling.Prunes Dropped Events On Partial Retry ✅ 7013ms
Partial Batch Handling.Retries Only Retry Events From Partial ✅ 7012ms
Partial Batch Handling.Partial Retry Preserves Uuids ✅ 7014ms
Partial Batch Handling.Partial Retry Attempt Header Increments ✅ 7014ms
Partial Batch Handling.Partial Retry Request Id Preserved ✅ 7012ms
Partial Batch Handling.Respects Retry After On Partial ✅ 7017ms
Partial Batch Handling.Unknown Result Treated As Terminal ✅ 3015ms
Partial Batch Handling.Mixed Ok Drop Warning No Retry ✅ 3019ms
Compression.Sends Gzip Content Encoding ✅ 13ms
Compression.No Content Encoding When Disabled ✅ 13ms
Compression.Compressed Body Is Decompressible ✅ 10ms
Error Handling.Does Not Retry On Unknown 4Xx ✅ 4012ms
Event Options.Cookieless Mode Override ✅ 12ms
Event Options.Disable Skew Correction Override ✅ 10ms
Event Options.Process Person Profile Override ✅ 13ms
Event Options.Product Tour Id Override ✅ 12ms
Event Options.Unset Options Omitted ✅ 12ms
Event Options.Options Override In Batch ✅ 13ms
Event Options.Unknown Option Passes Through ✅ 11ms
Event Options.Option Value Is Not Converted ✅ 13ms
Event Options.Lenient Bool Option Values Are Not Converted ✅ 15ms
Event Options.Option Wins Over Legacy Property ✅ 14ms
Event Options.Legacy Property Fills Unset Option ✅ 12ms
Event Options.Null Option Falls Back To Legacy Property ✅ 11ms
Event Size.Event Over Ceiling Is Not Sent ✅ 3257ms
Event Size.Over Ceiling Drop Is Reported Or Logged Without Content ✅ 2040ms
Event Size.Batches Close Before Byte Target ✅ 6057ms
Geoip And Historical Migration.Historical Migration Absent By Default ✅ 16ms
Property Layers.Caller Property Beats Registered Property ✅ 11ms
Property Layers.Before Send Runs Last ✅ 10ms
Fail Open.Empty Api Key Sends Nothing ✅ 1006ms
Fail Open.Personal Api Key Sends Nothing ✅ 1009ms

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 ✅ 19ms
Request Payload.Flags Request Hits Flags Path Not Decide ✅ 13ms
Request Payload.Flags Request Omits Authorization Header ✅ 11ms
Request Payload.Token In Flags Body Matches Init ✅ 10ms
Request Payload.Groups Round Trip ✅ 13ms
Request Payload.Groups Default To Empty Object ✅ 14ms
Request Payload.Disable Geoip False Propagates As Geoip Disable False ✅ 13ms
Request Payload.Disable Geoip Omitted Defaults To False ✅ 9ms
Request Payload.Flag Keys To Evaluate Contains Only Requested Key ✅ 10ms
Request Lifecycle.No Flags Request On Init Alone ✅ 5ms
Request Lifecycle.No Flags Request On Normal Capture ✅ 11ms
Request Lifecycle.Two Flag Calls Produce Two Remote Requests ✅ 14ms
Request Lifecycle.Mock Response Value Is Returned To Caller ✅ 11ms
Retry Behavior.Retries Flags On 502 ✅ 313ms
Retry Behavior.Retries Flags On 504 ✅ 315ms
Side Effect Events.Get Feature Flag Captures Feature Flag Called Event ✅ 12ms

@turnipdabeets
turnipdabeets marked this pull request as ready for review November 12, 2026 20:05
@turnipdabeets
turnipdabeets requested a review from a team as a code owner November 12, 2026 20:05
@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

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

Contained documentation-generation and test changes; no runtime SDK, dependency, or deployment behavior changes and no outstanding review concerns.

  • Author wrote 12% of the modified lines and has 38 merged PRs in these paths (familiarity MODERATE).
  • 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 ✓ 13L, 1F substantive, 160L/6F incl. docs/generated/snapshots — within ceiling
tier ✓ T1-agent / T1d-complex (160L, 6F, cross-cutting, fix)
stamphog 2.8.0 .stamphog/policy.yml @ 3d2ae17 · reviewed head 3d2ae17

@turnipdabeets
turnipdabeets merged commit 6c88c13 into chore/v4-remove-deprecated Nov 12, 2026
12 checks passed
@turnipdabeets
turnipdabeets deleted the fix/v4-release-review-followups branch November 12, 2026 20:11
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.

1 participant