Skip to content

chore!: adopt posthog-android 4.0 - #663

Open
turnipdabeets wants to merge 1 commit into
chore/v6-adopt-posthog-ios-4from
chore/v6-adopt-posthog-android-4
Open

turnipdabeets wants to merge 1 commit into
chore/v6-adopt-posthog-ios-4from
chore/v6-adopt-posthog-android-4

Conversation

@turnipdabeets

Copy link
Copy Markdown
Contributor

💡 Motivation and Context

posthog_flutter 6.0 adopts posthog-android 4.0 (PostHog/posthog-android#871), so the 6.0 Flutter callbacks can carry the same flag data on Android as on iOS (see the stacked PR that passes the loaded flags to onFeatureFlags and reloadFeatureFlags).

The Flutter Android plugin calls none of the APIs posthog-android 4.0 removes (apiKey, propertiesSanitizer, evaluationEnvironments, getFeatureFlagPayload, debouncerDelayMs, remoteConfig) and none of the internal classes PostHog/posthog-android#872 makes non-public, so this is only the dependency range: [3.71.0,4.0.0) → [4.0.0,5.0.0).

Merge order: like #649 for posthog-ios, this can't go green until posthog-android 4.0 is published. Merge it into #649's branch after that.

💚 How did you test it?

  • Not yet built: posthog-android 4.0 isn't published. I'll build the example app against a local publishToMavenLocal of the 4.0 branch before marking this ready.

📝 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

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Claude Code (Claude Opus 5.5) checked the plugin's posthog-android usage against the 4.0 removals and the API narrowing in PostHog/posthog-android#872. Part of the feature flag parity work for the iOS, Android and Flutter majors.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

posthog-flutter Compliance Report

Date: 2026-10-26 18:41:49 UTC
Duration: 96883ms

✅ All Tests Passed!

45/45 tests passed


Capture Tests

✅ 29/29 tests passed

View Details
Test Status Duration
Format Validation.Event Has Required Fields ✅ 144ms
Format Validation.Event Has Uuid ✅ 120ms
Format Validation.Event Has Lib Properties ✅ 116ms
Format Validation.Distinct Id Is String ✅ 117ms
Format Validation.Token Is Present ✅ 116ms
Format Validation.Custom Properties Preserved ✅ 118ms
Format Validation.Event Has Timestamp ✅ 117ms
Retry Behavior.Retries On 503 ✅ 5332ms
Retry Behavior.Does Not Retry On 400 ✅ 2118ms
Retry Behavior.Does Not Retry On 401 ✅ 2119ms
Retry Behavior.Respects Retry After Header ✅ 8122ms
Retry Behavior.Implements Backoff ✅ 15446ms
Retry Behavior.Retries On 500 ✅ 5227ms
Retry Behavior.Retries On 502 ✅ 5227ms
Retry Behavior.Retries On 504 ✅ 5229ms
Retry Behavior.Max Retries Respected ✅ 15441ms
Deduplication.Generates Unique Uuids ✅ 126ms
Deduplication.Preserves Uuid On Retry ✅ 5224ms
Deduplication.Preserves Uuid And Timestamp On Retry ✅ 10336ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry ✅ 5231ms
Deduplication.No Duplicate Events In Batch ✅ 125ms
Deduplication.Different Events Have Different Uuids ✅ 119ms
Compression.Sends Gzip When Enabled ✅ 118ms
Batch Format.Uses Proper Batch Structure ✅ 114ms
Batch Format.Flush With No Events Sends Nothing ✅ 109ms
Batch Format.Multiple Events Batched Together ✅ 126ms
Error Handling.Does Not Retry On 403 ✅ 2116ms
Error Handling.Does Not Retry On 413 ✅ 2119ms
Error Handling.Retries On 408 ✅ 5224ms

Feature_Flags Tests

✅ 16/16 tests passed

View Details
Test Status Duration
Request Payload.Request With Person Properties Device Id ✅ 13ms
Request Payload.Flags Request Uses V2 Query Param ✅ 10ms
Request Payload.Flags Request Hits Flags Path Not Decide ✅ 11ms
Request Payload.Flags Request Omits Authorization Header ✅ 9ms
Request Payload.Token In Flags Body Matches Init ✅ 10ms
Request Payload.Groups Round Trip ✅ 10ms
Request Payload.Groups Default To Empty Object ✅ 10ms
Request Payload.Person Properties Distinct Id Auto Populated When Caller Omits It ✅ 10ms
Request Payload.Disable Geoip False Propagates As Geoip Disable False ✅ 9ms
Request Payload.Disable Geoip Omitted Defaults To False ✅ 10ms
Request Payload.Flag Keys To Evaluate Contains Only Requested Key ✅ 11ms
Request Lifecycle.No Flags Request On Init Alone ✅ 4ms
Request Lifecycle.No Flags Request On Normal Capture ✅ 113ms
Request Lifecycle.Two Flag Calls Produce Two Remote Requests ✅ 17ms
Request Lifecycle.Mock Response Value Is Returned To Caller ✅ 10ms
Side Effect Events.Get Feature Flag Captures Feature Flag Called Event ✅ 115ms

@turnipdabeets
turnipdabeets marked this pull request as ready for review October 23, 2026 17:05
@turnipdabeets
turnipdabeets requested a review from a team as a code owner October 23, 2026 17:05
@turnipdabeets
turnipdabeets force-pushed the chore/v6-adopt-posthog-ios-4 branch from c322313 to 852c2c9 Compare October 26, 2026 18:36
@turnipdabeets
turnipdabeets force-pushed the chore/v6-adopt-posthog-android-4 branch from 2aa9ae4 to da3dedd Compare October 26, 2026 18:37
"posthog_flutter": major
---

- **Breaking:** adopt `posthog-android` 4.x

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Adopting posthog-android 4.0 moves Android events to capture v1 (/i/v1/analytics/events). A reverse proxy must forward the new path and the Authorization header, or events are dropped. Could the changeset say so and link the posthog-android 4.0 migration guide, as the Windows and Linux changeset does?

This branch has not been deployed

No deployments
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