Skip to content

feat!: posthog-android 4.0 and posthog 7.0 - #871

Open
turnipdabeets wants to merge 60 commits into
mainfrom
chore/v4-remove-deprecated
Open

turnipdabeets wants to merge 60 commits into
mainfrom
chore/v4-remove-deprecated

Conversation

@turnipdabeets

@turnipdabeets turnipdabeets commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Important

This is the posthog-android 4.0 integration PR. Don't merge it until every item under "Before release" is done. "Release day" and "After release" items don't block the merge. All stacked 4.0 PRs are merged into this branch (chore/v4-remove-deprecated), and this PR merges them into main at once. The branch carries the core and Android changeset .changeset/android-v4-major.md, the Android-only .changeset/android-v4-replay-and-device.md, and the server-only .changeset/server-keep-on-feature-flags.md.

Closes #822

💡 Motivation and Context

posthog-android 4.0 and core posthog 7.0:

  • Analytics events go to capture v1 (/i/v1/analytics/events), and the new captureAi sends AI events to /i/v1/ai/events.
  • Per-event capture options, and one property precedence: SDK-set, then super properties, then event properties, then beforeSend.
  • APIs deprecated in 3.x are removed, the feature flags callback changes, and session replay always records masked screenshots.

The upgrade guide is MIGRATION.md.

Docs and onboarding that ship with this release (merge once 4.0.0 is on Maven Central):

What gets released

Artifact Bump Why
posthog-android 3.77.1 → 4.0.0 The real major for app developers.
posthog (core) 6.49.1 → 7.0.0 PostHog, PostHogConfig, PostHogInterface and the flags types live in core, so the Android API breaks are core API breaks. Apps get core 7.0 through posthog-android 4.0.
posthog-server 2.24.2 → 2.25.0 Re-exports core through api(project(":posthog")), so 2.25 pulls in core 7.0. Its own API is unchanged (PostHogOnFeatureFlags moves into it with the same name), it stays on /batch and its own PostHogMemoryQueue, and PostHogEvent keeps its 3.x constructor and copy.
posthog-android-surveys-compose not released Its main source is identical at the 0.5.0 and 0.5.1 tags, on main and here, and it only uses APIs 4.0 keeps, so the published 0.5.x works with 4.0. Verified on device (survey below).
posthog-server-openfeature not released Only uses com.posthog.server.*.

The Flutter and React Native Android plugins are unaffected until they move to 4.0: Flutter 5 pins [3.75.0,4.0.0) and React Native pins exact 3.x versions. With #974, core 7.0 makes Gradle upgrade the app's posthog-android 3.x to 4.0, so posthog-server 2.25 next to posthog-android 3.x resolves 4.0 instead of crashing at runtime. A Flutter 5 app that also pulls in core 7 still crashes at runtime: the posthog_flutter 5 plugin compiles in its own Gradle project against 3.x and calls APIs 4.0 removes (checked with posthog_flutter 5.60.2). The guide covers both.

Merged into this branch

PR Change
this PR's first commit Remove deprecated APIs: apiKey, propertiesSanitizer, evaluationEnvironments, getFeatureFlagPayload(), debouncerDelayMs
#872 Make SDK-internal helpers non-public
#874 Remove the deprecated remoteConfig option
#877 Pass the load result to the feature flags callback (PostHogFeatureFlagsCallback)
#878 Add an onFeatureFlags listener you can unsubscribe
#889 Return null for malformed feature flag payloads
#908 Remove wireframe session replay capture
#917 Remove defaultValue from getFeatureFlag
#918 Remove PostHogConfig.onFeatureFlags in favor of the listener
#935 Decode payloads cached by 3.x from the cached flag details
#974 Align posthog-android to core's major with a Gradle constraint
#976 Release review follow-ups: the generated migration page is built from MIGRATION.md, the guide describes #974's Gradle upgrade, and two personless dedup tests test something again
#942, #956 Keep $lib and $lib_version on capture v1 events, filled last and as a pair
#948 A listener added with onFeatureFlags after setup() gets its catch-up on the main thread without waiting for the startup load
#949 An empty-string variant reads as disabled in getFeatureFlagResult and PostHogFeatureFlagsLoaded
#950 Hide @PostHogInternal declarations from the API dump
#951 Omit $feature_flag_response for a missing flag
#954 Let wrapper SDKs register capture options for every event
#955 Keep null array elements in event properties
#965 Skip the person-properties hash for updates that may be personless
#973 Sort the migration guide into Before, During and Follow ups
#979 A registered $process_person_profile (or wrapper-registered option) no longer applies to $identify, $create_alias, $merge_dangerously, $groupidentify, $set and $set_once, so it can't stop identifying users
#881 Capture v1, per-event options, property precedence, captureAi, $locale/$app_language, wrapper beforeSend, and the capture v1 fixes (#897, #901, #902, #903, #904, #905, #909, #924, #927, #928, #929, #930, #934)

main is merged in up to the 3.76.0 release, including #922 (drop touches inside masked views), #937 (no $feature_flag_called for survey targeting flags) and #823 (compose activity and dialog windows into one scene, released in 3.76.0). A follow-up commit makes #922's touch hit test read the unmerged semantics tree, which the 4.0 mask walk uses. #823 is adapted to 4.0, which removes wireframe mode and RRStyle: a dialog's dim is a small translucent screenshot image stretched over the scene, and a dialog masked whole is a masked screenshot. Only that part is in the 4.0 changeset, since 3.76.0 already released the composed scene.

main is then merged up to 3.77.1: #967 (person-properties hash stored once the update is queued), #971 (disableGeoIp) and #970 (failed flag records read as unavailable). Where they conflicted with 4.0, 4.0's shape is kept and main's behavior comes through:

  • A failed flag reads as missing: getFeatureFlag returns null (4.0 has no defaultValue), and its $feature_flag_called omits $feature_flag_response instead of sending "", with main's $feature_flag_error (evaluation_failed, …) added.
  • disableGeoIp stamps $geoip_disable after the caller's properties, as on main. Under capture v1 it stays an event property (the capture v1 spec's geoip_disable_injected_into_properties), not an option, and it's on the minimal $feature_flag_called allowlist next to the legacy option properties.
  • Main's new tests are adapted to the capture v1 path and the 4.0 flag API. 3.77.x's changesets were already released from main, so the 4.0 changesets are unchanged.

sdk-specs: 4.0 implements the capture v1 contract (PostHog/sdk-specs#146, #147) and the property precedence from PostHog/sdk-specs#143. #881's description lists where Android differs from the spec. An event named only with whitespace is sent, as the capture spec only requires a non-empty name.

Release review changes in this PR

  • Rewrote both changesets: breaking entries first, one imperative line each, and added what was missing (2xx without results drops events, HTTP-date Retry-After, migrated 3.x queues, non-string map keys). The server changeset now lists the core changes it also gets: PostHogEvent.options, the map key fix, beforeSend copies and quieter debug logs.
  • Migration guide: surveys-compose users declare posthog-android 4.0.0 or later instead of 4.+; PostHog no longer saves non-JSON payloads, so only older payloads are affected; the first event after a language change carries the previous $locale or $app_language, and a runtime setOverrideLocaleConfig change alone isn't picked up (both confirmed on API 32 and API 37 emulators); a self-hosted proxy set up from PostHog's guides before 29 October 2026 strips Authorization, so events get 401 and are dropped.
  • Reading flags from an in-memory cache (PostHogMemoryPreferences) after close() and setup() threw a NullPointerException to the caller when a cached failed flag had no metadata. fix(flags): decode payloads cached by 3.x from the cached flag details #935's 3.x payload migration read metadata.payload unguarded. Fixed in 3cf406d4 with a regression test. Android's SharedPreferences cache wasn't affected.
  • Regenerated references/posthog-android-migration.md from MIGRATION.md (7bd8b195). It still said a registered $process_person_profile reaches identify, alias, group and setPersonProperties, which fix: keep a registered personless setting off identity events #979 changed. The release regenerates it too, but only as a best-effort step.
  • Scoped the changeset's debug-log entry to analytics and AI events: replay, logs, flags and remote config requests still print their bodies with debug on (found on the Android 8 run).

Before release

Release day, after 4.0.0 is on Maven Central

These pin 4.+, so they can't merge earlier. Until they do, the docs and onboarding pin 3.+ and their snippets compile on 3.x, so a few days' lag is fine.

After release

Follow-ups found during the review

No blocking issues. Nothing needs a follow-up PR before release.

  • A Gradle constraint for posthog-server, like fix: align posthog-android to core's major with a Gradle constraint #974's for posthog-android? An app with posthog-android 4.0 and posthog-server 2.24.x (directly or through posthog-server-openfeature 0.1.3) resolves core 7.0, and 2.24.x's asCoreConfig then fails at setup with NoSuchMethodError (it passes remoteConfig and onFeatureFlags). The guide documents it. A constraint would need the server version that ships with core 7.0.

  • Session replay drops frames with a SelectionContainer. When text masking is on and a screen has Text(…, Modifier.clearAndSetSemantics { … }) inside a SelectionContainer, the text node (SelectableTextAnnotatedStringNode) can't be measured, so the frame is discarded instead of masked. It's deliberate (fail closed, covered by frame is discarded when cleared semantics hide text we cannot measure), but neither the changeset nor the guide mentions it.

  • Low confidence: textPaintedBoundsCache is keyed by semantics node ID only. IDs are unique per SemanticsOwner, so two ComposeViews with the same node ID, text and size but a different shadow or stroke could share masked bounds.

  • Nit: the compliance adapter maps the harness's max_retries to pushNotificationSubscriptionMaxRetries, which doesn't affect capture retries.

  • @turnipdabeets: decide who should fix remote config on Android 6 and 7.0. It isn't new in 4.0 and doesn't block the release. us-assets.i.posthog.com and eu-assets.i.posthog.com serve a Let's Encrypt certificate chained to ISRG Root X1, which Android 7.0 and older don't trust, so /array/{token}/config fails with SSLHandshakeException: Trust anchor for certification path not found. /flags and capture work, because us.i.posthog.com uses Amazon's chain. Without remote config, those devices never start session replay, exception autocapture (Java/Kotlin and native) or surveys. Events, flags, logs and AI events still work, and nothing crashes. 3.x already always loaded remote config, so this already happens today. It's a fix for whoever owns the assets host's certificate (infra), not this SDK.

  • :posthog-android:animalsnifferRelease fails locally on this branch (1,237 violations, Gson and Kotlin signature false positives) and on main too (1,307), and CI doesn't run it. Fixing or removing that task is a separate cleanup.

💚 How did you test it?

The device runs below were on this branch before the 3.77.1 merge (9bbfa914, then the docs commits; Android 6–13 ran on 34198711), against PostHog Cloud project 381971 and a local mock PostHog server.

After merging 3.77.1 (830f7891): :posthog:test, :posthog-server:test, :posthog-server-openfeature:test, :posthog-android:testDebugUnitTest, apiCheck and spotlessCheck pass, after adapting main's 8 new tests to capture v1 and the 4.0 flag API. The device runs weren't repeated.

On the current head (7bd8b195, after 3cf406d4, #973, #979 and the regenerated migration page): CI Build & Test (compile, tests, survey interaction tests, release tasks and dependency locks) and test-android-sdk pass. SDK compliance passed on 9217eeca, which has the same code.

Automated

Check Result
spotlessCheck pass
apiCheck pass
make test (every module, debug tests, testWithoutCompose, Gradle plugin unit and functional tests) pass
:posthog-android:lintRelease pass
:posthog-android-surveys-compose:testDebugUnitTest (Compose survey UI) pass
:posthog:animalsnifferMain (API 23 signatures for core) pass
SDK compliance harness 1.26.0 in CI on the PR head (capture_v1, capture_ai_v1, feature_flags) 232/232 pass

Harness 1.27 and 1.28 only add flags v4 and flag rules v2 tests, which need the flags_response_v4 capability the adapter doesn't declare, so 1.26.0 runs the same tests.

Devices

Pixel 10a (Android 16), emulators for Android 6, 7.0, 8, 9, 10, 11, 12, 13 (API 23, 24, 26, 28, 29, 30, 31, 33; google_apis arm64), Android 14 (API 34) and Android 17 (API 37). Sample app built from this branch with a local driver activity (not committed), with debug, session replay, surveys, error tracking, logs, deep links and lifecycle and screen autocapture on. Results were read from logcat, from PostHog with SQL and Replay Vision, and from the mock server's request log.

Upgrade from 3.76.0 (Pixel offline, API 34 online)

Step Result
3.76.0 caches flags, then queues 5 events on disk while offline (with $process_person_profile and $session_id set as properties) 5 queued files
Install 4.0 over it, still offline, read flags cached values and payloads read correctly ({plan=premium, seats=5}), listener gets errorsLoading=true with the cached flags
Go online "Loaded 5 cached events from disk", resent under the same PostHog-Request-Id with PostHog-Attempt: 2; all 5 ingested, person-less, $session_id kept

New behavior (PostHog Cloud)

Feature Result
Capture v1 transport every analytics request went to /i/v1/analytics/events with Authorization: Bearer, PostHog-Sdk-Info, PostHog-Request-Id, PostHog-Attempt, gzip, no api_key body field
options and legacy option properties options = {process_person_profile: false}, a $process_person_profile: false property, a beforeSend that sets the option, and a registered $process_person_profile all made an identified user's event person-less; a plain event and the event after unregister stayed full; an unknown option didn't become a property
Property precedence registered $os_name beat the SDK value; event beat super; beforeSend beat both
userProperties vs $set userProperties won key by key, the other $set key was kept
$lib/$lib_version set by the app replaced from the header
$window_id = 123 dropped with a debug log naming only the type
Map keys 1, true, null, Any() sent as "1", "true", "null"; the object key was dropped with the rest of the event sent
Empty event name, beforeSend returning null dropped locally, logged
Blank distinctId argument event sent with the current distinct ID
300 KB property delivered
captureAi 2 MB $ai_generation and $ai_span delivered through /i/v1/ai/events; a 9 MiB event returned null and logged the limit only; a non-$ai_ name got PostHog's misrouted_event drop, logged per batch
identify, group, alias, setPersonProperties, captureException, screen with options all ingested
getFeatureFlag without a default premium, true, null for a missing flag; isFeatureEnabled("missing", true) returned true and its $feature_flag_called left out $feature_flag_response
onFeatureFlags ran on the main thread, received the current flags on registration and each reload, stopped after unsubscribe(), and stayed registered across close() and setup()
reloadFeatureFlags(callback) ran on PostHogRemoteConfigThread with a PostHogFeatureFlagsLoaded
phx_ project token SDK disabled, warning printed, nothing sent
$locale / $app_language $locale en-US; $app_language not sent by default, de-DE after cmd locale set-app-locales, fr-CA after setAppLanguage("fr-CA"), gone after clearing. The first event after each change still carried the previous value, as the code documents; the guide now says so
Deep link with $process_person_profile=true&$set=x Deep Link Opened kept utm_source and ref and skipped the $ parameters

Payload rules (mock /flags serving each payload kind)

Payload 4.0 result
hello, {broken, empty, {'a': 1}, null null, flag value still true
"hello", {"a": 1}, false, [1, 2] on a variant decoded to String, map, Boolean, list

PostHog Cloud now refuses to save a payload that isn't valid JSON, so this can only be tested with a mock or an old flag.

Transport errors (mock server, each scenario isolated)

Response Result
404 retried with the same request ID, attempt incremented; one warning printed
503 with Retry-After: 120 paused 30 s, not 120 s; resent on the next flush tick (38.7 s)
2xx asking to retry 1 of 3 events and drop 1 only that event resent, same request ID, attempt 2
2xx with {} dropped, not retried
307 to the same origin followed at once with the same request ID and body
307 to another origin, 302 dropped
413 for 4 events split into 2 + 2
400 dropped
429, 500 retried, same request ID
requestHeaders with Authorization and X-E2E capture requests replaced Authorization with the Bearer token and kept X-E2E; /config and /flags kept the app's Authorization

Regression

Area Result
Session replay Pixel session 01a1ac64-d968…: 92 snapshot events, 17 taps over 80 s across the native, Compose, survey, logs and error tracking screens; Replay Vision confirmed every screen is a screenshot with masked text and images and no broken or black frames
Surveys (published surveys-compose code path) temporary event-triggered popover showed, survey shown and survey sent (rating 4) ingested
Error tracking manual $exception (with steps) and a fatal crash, sent before the process died
Logs /i/v1/logs flushed 3 records
Autocapture Application Opened (including after the crash relaunch), $screen, $autocapture taps, Deep Link Opened
Same scenario set on Android 14 same 22 events ingested as on the Pixel

Android 6–13 (fresh emulator per version, same 4.0 build, PostHog Cloud)

Each emulator ran the same script: the full capture set (core events, options, precedence, identify/group/alias, captureException, captureAi with a 2 MB and a 9 MiB event), a deep link, five screens (native, Compose, interaction, survey), logs, a fatal crash and relaunch, then Home. The API levels cover every Build.VERSION_CODES branch in posthog-android (N, O, P, Q, R, S, TIRAMISU). Android 13 set a per-app language with cmd locale set-app-locales … fr-FR.

Android Events Screens + deep link AI lane Logs Replay Fatal crash $app_language
6.0 (23) all ✅ ✅ ✅ ❌ remote config TLS failure ❌ remote config TLS failure not sent
7.0 (24) all ✅ ✅ ✅ ❌ remote config TLS failure ❌ remote config TLS failure not sent
8.0 (26) all ✅ ✅ ✅ ✅ screenshots ✅ not sent
9 (28) all ✅ ✅ ✅ ✅ ✅ not sent
10 (29) all ✅ ✅ ✅ ✅ ✅ not sent
11 (30) all ✅ ✅ ✅ ✅ ✅ not sent
12 (31) all ✅ ✅ ✅ ✅ ✅ not sent
13 (33) all ✅ ✅ ✅ ✅ ✅ fr-FR
  • "All" means every test event ingested, including $identify, $groupidentify, $create_alias, $set and $feature_flag_called. $locale was en-US everywhere.
  • Every version dropped the empty-name event and the beforeSend-filtered test_event, and logged NaN and Infinity as unserializable instead of losing the event.
  • The 9 MiB captureAi call returned null without crashing on every version. On Android 6 it hit an OutOfMemoryError while serializing, which the SDK caught and logged.
  • Replay ran with logcat capture on, and the crash line reached the recording as console logs.
  • Android 6 and 7.0 fail remote config because of the certificate issue under Follow-ups. That's why replay and exception autocapture stay off there.
  • On Android 7 and 8, Application Backgrounded didn't arrive. The "app has stopped" dialog kept the crashed process alive until the script pressed Home, which killed it. That's a test artifact, not an SDK issue.
  • No crash came from the SDK on any version. The only fatal exception was the intended one.
  • Replay Vision watched an Android 8 re-run with 30 taps (recording). The native, Compose, interaction, survey and main screens were all real screenshots, with no black, blank, cropped or corrupted frames. Text was visible because the sample app turns image and input masking off.

The temporary survey is archived; the e2e test events stay in the test project only.

📝 Checklist

  • All commits are signed
  • 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) wrote the stacked PRs and ran this release review: it merged main (3.76.0) into the branch, rewrote the changesets and fixed the guide, checked which unreleased artifacts link against core 7.0, and ran the automated suite and the device tests above. The device driver activity, the 3.76.0 upgrade build and the mock server stayed local and aren't committed.

🤖 Generated with Claude Code

@turnipdabeets turnipdabeets self-assigned this Oct 22, 2026
@turnipdabeets
turnipdabeets marked this pull request as ready for review October 22, 2026 19:43
@turnipdabeets
turnipdabeets requested a review from a team as a code owner October 22, 2026 19:43
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

posthog-android Compliance Report

Date: 2026-11-16T15:03:29.740009+00:00
Duration: 474668ms

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

Capture_Ai_V1 Tests

✅ 110/110 tests passed

View Details
Test Status Duration
Endpoint And Method.Targets V1 Endpoint ✅ 16ms
Endpoint And Method.Does Not Use Legacy Endpoints ✅ 15ms
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 ✅ 7027ms
Required Headers.Has Authorization Bearer Header ✅ 16ms
Required Headers.Has Content Type Json ✅ 19ms
Required Headers.Has Posthog Sdk Info Format ✅ 15ms
Required Headers.Has Posthog Attempt Header ✅ 15ms
Required Headers.Has Posthog Request Id ✅ 16ms
Required Headers.Has Posthog Request Timestamp ✅ 16ms
Required Headers.Has User Agent ✅ 15ms
Body Format.Body Has Created At And Batch ✅ 13ms
Body Format.No Api Key In Body ✅ 13ms
Body Format.No Sent At In Body ✅ 14ms
Event Format.Event Has Required Root Fields ✅ 13ms
Event Format.Event Uuid Is Valid ✅ 13ms
Event Format.Event Timestamp Is Rfc3339 ✅ 13ms
Event Format.Non Utc Event Timestamp Is Converted To Utc ✅ 13ms
Event Format.Distinct Id Is String ✅ 14ms
Event Format.Distinct Id At Root Not Properties ✅ 11ms
Event Format.Custom Properties Preserved ✅ 14ms
Event Format.Set Properties Preserved ✅ 15ms
Event Format.Set Once Properties Preserved ✅ 14ms
Event Format.Groups Properties Preserved ✅ 13ms
Event Format.Sdk Generates Uuid If Not Provided ✅ 18ms
Event Format.Event Has Required Root Fields Batch ✅ 18ms
Event Format.Event Uuid Is Valid Batch ✅ 21ms
Event Format.Event Timestamp Is Rfc3339 Batch ✅ 18ms
Event Format.Distinct Id Is String Batch ✅ 20ms
Event Format.Distinct Id At Root Not Properties Batch ✅ 21ms
Event Format.Custom Properties Preserved Batch ✅ 21ms
Event Format.Set Properties Preserved Batch ✅ 19ms
Event Format.Set Once Properties Preserved Batch ✅ 23ms
Event Format.Groups Properties Preserved Batch ✅ 24ms
Event Format.Sdk Generates Uuid If Not Provided Batch ✅ 17ms
Batch Behavior.Multiple Events In Single Batch ✅ 27ms
Batch Behavior.Batch Envelope Smoke ✅ 24ms
Batch Behavior.Flush At Triggers Batch ✅ 1017ms
Batch Behavior.Created At Reflects Batch Creation Time ✅ 16ms
Deduplication.Generates Unique Uuids ✅ 26ms
Deduplication.Different Events Same Content Different Uuids ✅ 16ms
Deduplication.Preserves Uuid On Retry ✅ 7013ms
Deduplication.Preserves Timestamp On Retry ✅ 7014ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry ✅ 7015ms
Deduplication.No Duplicate Events In Batch ✅ 27ms
Header Behavior On Retry.Attempt Header Starts At One ✅ 16ms
Header Behavior On Retry.Attempt Header Increments On Retry ✅ 12023ms
Header Behavior On Retry.Request Id Preserved On Retry ✅ 7014ms
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 ✅ 14ms
Response Format Validation.Success Response Has Ok For Each Event ✅ 17ms
Response Format Validation.Success No Retry After When All Ok ✅ 18ms
Response Format Validation.Success Retry After Present When Retry Events ✅ 2009ms
Response Format Validation.Success No Retry After When Drop Only ✅ 17ms
Response Format Validation.Response Echoes Request Id ✅ 12ms
Retry Behavior.Retries On 408 ✅ 7009ms
Retry Behavior.Retries On 500 ✅ 7015ms
Retry Behavior.Retries On 503 ✅ 7024ms
Retry Behavior.Retries On 504 ✅ 7014ms
Retry Behavior.Retries On 404 ✅ 6010ms
Retry Behavior.Retries On 429 ✅ 6014ms
Retry Behavior.Retries On 502 ✅ 7014ms
Retry Behavior.Retryable Errors Have Retry After ✅ 4009ms
Retry Behavior.Respects Retry After On Retryable Error ✅ 10014ms
Retry Behavior.Does Not Retry On 400 ✅ 4015ms
Retry Behavior.Does Not Retry On 401 ✅ 4015ms
Retry Behavior.Does Not Retry On 402 ✅ 4014ms
Retry Behavior.Does Not Retry On 413 ✅ 4016ms
Retry Behavior.Does Not Retry On 415 ✅ 4014ms
Retry Behavior.Non Retryable Errors Have No Retry After ✅ 4013ms
Retry Behavior.Implements Backoff ✅ 14023ms
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 ✅ 3021ms
Partial Batch Handling.Does Not Retry Warning Events ✅ 3018ms
Partial Batch Handling.Prunes Ok Events On Partial Retry ✅ 7014ms
Partial Batch Handling.Prunes Dropped Events On Partial Retry ✅ 7014ms
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 ✅ 7013ms
Partial Batch Handling.Partial Retry Request Id Preserved ✅ 7013ms
Partial Batch Handling.Respects Retry After On Partial ✅ 7021ms
Partial Batch Handling.Unknown Result Treated As Terminal ✅ 3018ms
Partial Batch Handling.Mixed Ok Drop Warning No Retry ✅ 3024ms
Compression.Sends Gzip Content Encoding ✅ 16ms
Compression.No Content Encoding When Disabled ✅ 16ms
Compression.Compressed Body Is Decompressible ✅ 16ms
Error Handling.Does Not Retry On Unknown 4Xx ✅ 4017ms
Event Options.Cookieless Mode Override ✅ 14ms
Event Options.Disable Skew Correction Override ✅ 9ms
Event Options.Process Person Profile Override ✅ 12ms
Event Options.Product Tour Id Override ✅ 12ms
Event Options.Unset Options Omitted ✅ 13ms
Event Options.Options Override In Batch ✅ 16ms
Event Options.Unknown Option Passes Through ✅ 15ms
Event Options.Option Value Is Not Converted ✅ 15ms
Event Options.Lenient Bool Option Values Are Not Converted ✅ 13ms
Event Options.Option Wins Over Legacy Property ✅ 14ms
Event Options.Legacy Property Fills Unset Option ✅ 13ms
Event Options.Null Option Falls Back To Legacy Property ✅ 15ms
Event Size.Event Over Ceiling Is Not Sent ✅ 3238ms
Event Size.Over Ceiling Drop Is Reported Or Logged Without Content ✅ 2040ms
Event Size.Batches Close Before Byte Target ✅ 6060ms
Geoip And Historical Migration.Historical Migration Absent By Default ✅ 12ms
Property Layers.Caller Property Beats Registered Property ✅ 10ms
Property Layers.Before Send Runs Last ✅ 11ms
Fail Open.Empty Api Key Sends Nothing ✅ 1007ms
Fail Open.Personal Api Key Sends Nothing ✅ 1008ms

Feature_Flags Tests

✅ 17/17 tests passed

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

@marandaneto
marandaneto marked this pull request as draft October 23, 2026 08:55
@marandaneto

Copy link
Copy Markdown
Member

moved to draft since its not mergeable yet

Remove the public APIs already marked deprecated: apiKey and the
apiKey factories, propertiesSanitizer and PostHogPropertiesSanitizer,
evaluationEnvironments, getFeatureFlagPayload, and the replay
debouncerDelayMs. remoteConfig moves to its own change because
setting it to false still changes setup behavior.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@turnipdabeets
turnipdabeets force-pushed the chore/v4-remove-deprecated branch from a41d9b9 to caf64bd Compare October 26, 2026 18:47
@turnipdabeets
turnipdabeets marked this pull request as draft October 26, 2026 22:43
turnipdabeets and others added 3 commits October 26, 2026 19:09
Matches posthog-ios 4.0 and the sdk-specs payload decoding contract.
* chore!: make SDK-internal helpers non-public for posthog-android 4.0

Make internal the public declarations that no other module in this repo
and no wrapper (Flutter, React Native, KMP) uses. LogLine and LogcatParser
are Java, so they become package-private.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix: keep GzipRequestInterceptor public for the compliance adapter

sdk_compliance_adapter is a separate Gradle module, only included by its
Dockerfile, and constructs GzipRequestInterceptor directly.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Setup now always loads /config. With remoteConfig = false, setup used to skip
/config, which left remote settings unloaded since /flags stopped returning
config.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* chore!: pass the load result to the feature flags callback

PostHogConfig.onFeatureFlags and reloadFeatureFlags() now take a PostHogFeatureFlagsCallback, whose loaded() receives a PostHogFeatureFlagsLoaded with the enabled flags, their values, and errorsLoading, matching posthog-ios 4.0. Every path that invoked the callback passes an accurate result, including failures, a disabled SDK, and bootstrap.

PostHogOnFeatureFlags moves to posthog-server under the same name, so the server's API is unchanged and it can drop the type in its own major.

* chore: drop the unused server callback wrapper

posthog-server calls its own PostHogOnFeatureFlags directly, and the core stateless client never calls config.onFeatureFlags. Bump posthog-server to minor since it now depends on core 7.0, and document that a bootstrapped onFeatureFlags runs on the setup() thread.

* fix: report persisted flags when the first flags load fails

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

* fix: isolate the bootstrap internal flags callback from setup

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

* fix: keep loaded flags when a flags reload fails

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

* fix: retry flag cache hydration while storage is unreadable

A failed load now hydrates the flag cache before the callback. Under Direct
Boot that read returned empty values and latched, so persisted flags stayed
hidden after unlock. Only latch once the preferences are readable.

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

* fix: skip flag cache reads while storage is unreadable

Every flag getter retried hydration under Direct Boot and re-read each cached
key, each read failing against locked preferences. Check availability once and
skip the reads until storage is readable.

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

* fix: don't let cache hydration undo a concurrent reset

Hydration reads the cache off the flags lock, so a reset() landing between the
read and the commit had the previous identity's flags restored. clear() now
bumps a generation and hydration drops a commit from an older one.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
gewenyu99 added a commit that referenced this pull request Nov 11, 2026
)

* docs: generate the SDK reference for 3.x

Generated by bin/docs_scripts/generate_markdown.py.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* docs: generate the experimental SDK reference for 4.x

Generated by bin/docs_scripts/generate_markdown.py --major 4 --experimental from feat/v4-capture-v1 (PRs #871 and #881), with the capability tags applied on top. Adds the 3.x to 4.0 migration guide page.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* docs: regenerate the Android references from Dokka's HTML

The 4.x page and migration guide come from chore/v4-remove-deprecated (the 4.0
branch) with the capability tags and getting-started applied. Both still need to
land there.

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

* docs: regenerate the Android references with braces kept in code

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

* docs: regenerate the Android references from docs/capabilities.json

The 3.x pages lose only the blank line the stripped capability tags left behind. The 4.x page also
moves captureAi to Capture AI and onFeatureFlags to On feature flags, which the map's "next"
entries add.

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

* docs: regenerate the Android references after review fixes

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

* docs: regenerate the Android migration page from the current 4.0 guide

Rebuilt from docs/migration-3.x-to-4.0.md on chore/v4-remove-deprecated,
which dropped the SDK identity section (#942) and added the custom
httpClient paragraph.

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

* docs: regenerate the Android migration page from the current 4.0 guide

Rebuilt from docs/migration-3.x-to-4.0.md on chore/v4-remove-deprecated,
which now covers the missing-flag response, posthog-server 2.25 and retry scope.

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

* docs: regenerate the Android 4.x page from chore/v4-remove-deprecated

Picks up the branch's feature flag doc comment fixes.

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

* docs: regenerate the references with the getting-started intro

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

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
turnipdabeets and others added 3 commits November 12, 2026 09:11
* fix: skip the person-properties hash for maybe-personless updates

A process_person_profile value capture can't read as false, such as "maybe" or
"true", counted as person-processed, so the $set stored and matched the dedupe
hash. PostHog may drop or not apply that update, so the same properties sent
later were dropped as a duplicate. Mirror posthog-ios #1050: only a missing
setting or a Boolean true uses the hash, and an update PostHog might apply
clears it. A setting capture reads as false still leaves the hash as it is.

Claude-Session: https://claude.ai/code/session_019xLynttdFZAHfqTem5BhPQ

* fix: clear the person-properties hash for every update that may be personless

Match posthog-ios #1050: only a missing process_person_profile or a Boolean
true checks and records the hash. Any other value, including a definite
false, is sent and clears the stored hash, so the SDK no longer depends on
parsing false spellings the way the server does.

Claude-Session: https://claude.ai/code/session_019xLynttdFZAHfqTem5BhPQ
# Conflicts:
#	posthog/src/main/java/com/posthog/PostHog.kt
…e migration guide

Capture v1 moved to /docs/api/capture-v1 (posthog.com#21385).
…974)

posthog-android 3.x calls core APIs that 7.0 removes, so an app that pins
core 7.x next to posthog-android 3.x crashes with NoSuchMethodError when it
builds PostHogAndroidConfig. Publish a constraint from core to posthog-android
at the matching major so Gradle upgrades posthog-android instead.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* docs: publish MIGRATION.md as the SDK's migration guide page

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>

* docs: say Gradle upgrades posthog-android 3.x to 4.0 next to core 7.0

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>

* test: queue events in the personless hash tests and fix a Retry-After 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>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
turnipdabeets and others added 5 commits November 13, 2026 11:00
Keeps the 4.0 shapes where main conflicts: $feature_flag_response is still
omitted for a missing or failed flag and getFeatureFlag has no defaultValue;
main's $feature_flag_error and disableGeoIp ($geoip_disable stays a property
under capture v1) come through. Main's new tests are adapted to the capture v1
path and the 4.0 flag API.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gson can build a failed FeatureFlag record without its metadata object, and
the 3.x payload migration read flag.metadata.payload unguarded, so the first
flag read after reopening a PostHogMemoryPreferences cache threw a
NullPointerException to the caller.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ange (#973)

* docs: sort the Android 4.0.0 migration guide by when you make each change

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

* docs: keep the 4.0.0 guide's table cells to one value

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

* docs: move the posthog.com Android SDK page into the reference

The posthog.com Android SDK page redirects to this reference once
4.0.0 ships, so its setup, how-to, and configuration sections now live
in docs/getting-started.md.

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

* docs: title a single migration guide's page with its H1

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 2eeb772)

* docs: publish the root MIGRATION.md as the migration page

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit f7650a7)

* Revert "docs: move the posthog.com Android SDK page into the reference"

This reverts commit 0e67e30.

* docs: add the Android facts from the retired posthog.com page that no other page has

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

* docs: move the Android one-API facts from getting-started into KDoc

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

* docs: preserve Android tracing setup

* docs: name the SDK in versions, cut self-hosted notes, and split dashes and semicolons

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

* docs: address review on the reordered 4.0 migration guide

- Move "Upgrade your dependencies" and "Upgrade posthog-server" to During:
  both come down to declaring posthog-android 4.0.0.
- Give the PostHogStateless break its own During section and checklist item.
- Drop "Check timestamps and IDs": nothing in it changes but the request ID
  header, which the proxy section covers.
- Say what staying on capture costs for $ai_* events, scope the intro to
  analytics and AI events, and say why follow ups can wait.
- disableGeoIp exists now (main's #971), so the guide no longer says there's
  no GeoIP setting. Name the real remote config path.
- Regenerate references/posthog-android-migration.md.

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

* docs: say flush doesn't block, and register persists across app restarts

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

* docs: pass the migration page generator one guide

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

* docs: point the copy page button at posthog.com and reword the change categories

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

* docs: restore the self-hosted note on serving capture v1

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Anna Garcia <anna.g@posthog.com>
* fix: keep a registered personless setting off identity events

A registered `$process_person_profile: false`, or a `process_person_profile`
option a wrapper registers, no longer applies to `$identify`, `$create_alias`,
`$merge_dangerously`, `$groupidentify`, `$set` and `$set_once`. PostHog drops
those events with person processing off. A value passed on the call or set
in `beforeSend` still applies.

* docs: note the identity-event exception on register

* docs: keep the $set and $set_once distinction in the migration guide

* test: cover $set_once, $merge_dangerously, a call property and beforeSend
The generated page still told users that a registered
$process_person_profile reaches identify, alias, group and
setPersonProperties, which #979 changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@turnipdabeets
turnipdabeets marked this pull request as ready for review November 13, 2026 20:55
@veria-ai

veria-ai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Reviews

@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 7bd8b19: 1 Must fix, 3 Should fix. This pull request is large, so the review ran in 4 parts with less depth than usual.

See this review and its findings in PostHog Review. Comment @posthog review --deep for a Deep review. A Deep review takes longer and looks deeper than a Standard review.

* fix: close replay masking and legacy retry gaps from 4.0 review

- Mask Compose text that a negative TextIndent paints left of its layout
  box (or right of it, for right-to-left text).
- Read cleared text semantics from SemanticsModifier elements on Compose
  1.0-1.2, which have no getTail, instead of discarding every frame.
- Re-queue one copy per uuid when capture asks to retry legacy events,
  since it drops a uuid's later copies in a batch for good.

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

* fix: measure only rendered text and keep node runtimes fail-closed

- Skip clearAndSetSemantics { text = ... } replacements when looking for
  the text to measure: only semantics with GetTextLayoutResult count.
- A missing getTail is only expected on pre-1.3 layout wrappers. On a
  NodeCoordinator it throws again, so the frame is discarded.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

@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 3433e90: no findings. This pull request is large, so the review ran in 4 parts with less depth than usual.

@turnipdabeets turnipdabeets mentioned this pull request Nov 16, 2026
6 tasks done
@turnipdabeets

Copy link
Copy Markdown
Contributor Author

Adding one more 4.0 change: #984 flips PostHogConfig.surveys to default to true, matching iOS, Flutter, RN, web and KMP (from this comment on posthog-kmp#125). It adds its own changeset line and a "Check surveys" section to MIGRATION.md. Apps without posthog-android-surveys-compose or a custom surveysDelegate see no visible change.

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.

$locale collected different from iOS

6 participants