Repository navigation
chore!: Flutter Major Release v6 - #637
turnipdabeets wants to merge 69 commits into
Conversation
|
[High risk] Upgrades PostHog iOS SDK and removes deprecated APIs. The reviewed changes appear safe to merge, with one non-blocking release-note correction. Reviews (1) · Last reviewed commit: "chore!: adopt posthog-ios 4.0 and remove..." |
posthog-flutter Compliance ReportDate: 2026-11-20T22:00:38.413003+00:00 ✅ All Tests Passed!232/232 tests passed Capture_V1 Tests✅ 105/105 tests passed View Details
Capture_Ai_V1 Tests✅ 110/110 tests passed View Details
Feature_Flags Tests✅ 17/17 tests passed View Details
|
b996dea to
047d564
Compare
0ae4f04 to
9279d41
Compare
5fced53 to
5022778
Compare
e1927f4 to
a700edb
Compare
|
This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the |
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>
|
The Dart test jobs fail on |
#721's failed-flags test answered every request with a /flags body, which the capture v1 sender reads as a 2xx without per-event results. Answer only /flags with it so capture gets its default results. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Flutter 3.50.0 stable (2026-11-11) ships flutter/flutter#184590, so `flutter build swift-package` no longer needs a podspec for a module's plugins. Verified: a 3.50 module with posthog_flutter 6 generates and compiles its Swift package for the iOS simulator. Modules don't target macOS, so the module text covers iOS only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
…ange (#726) * docs: sort the Flutter 6.0.0 migration guide by when you make each change Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: keep the 6.0.0 guide's table cells to one value Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: name the platforms that move to capture v1 in the 6.0.0 guide Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: move the posthog.com Flutter SDK page into the reference The posthog.com Flutter SDK page redirects to this reference once 6.0.0 ships, so its setup, how-to, and product 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 efbeb50) * Revert "docs: move the posthog.com Flutter SDK page into the reference" This reverts commit 5a477a6. * docs: add the Flutter facts from the retired posthog.com page that no other page has Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: preserve flutter reference details * 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 sorted 6.0.0 migration guide - Intro: only analytics and AI events move to capture v1; replay, logs, flags and web keep their endpoints - Follow ups: say why they can wait (6.x.x still accepts the old names) - Redirects: iOS, macOS and Android follow the same same-origin 307/308 rule; in 5.x.x they followed redirects to any host - Native guide links point at #prepare-your-proxy and the native long-ID sections, which now exist there - Send AI events: $ai_* events sent with capture still arrive, so the move to captureAi stays a follow up - Checklist items for the six sections that had none (flag values, batch sizes, timestamps and IDs, queued events, reachability, rollback) - Regenerate references/posthog-flutter-migration.md 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>
Brings in disableGeoIp (#720). Conflict resolutions: - Android keeps the strict posthog-android [4.0.0, 5.0.0) range; 4.0 has PostHogConfig.disableGeoIp, so the plugin sets it next to the native beforeSend hooks. - PostHogConfig.toMap() stays removed; disableGeoIp goes through channel_serialization.dart. - The compliance adapter keeps the capture v1 client path, with the parameter renamed to disableGeoIp. - ci.yml: the iOS simulator boot step from main was gated on the cocoapods matrix leg, which 6.0 removed, so the plugin tests would have run without a simulator id. It now runs for every iOS leg. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ioannisj
left a comment
There was a problem hiding this comment.
🤖 An AI agent wrote this on behalf of @ioannisj.
Nothing blocking from my side. The one thing I'd look at is the desktop beforeSend shape for a legacy $set: it doesn't match what the new PostHogEvent doc says, so a redaction written against the doc misses the value on Windows and Linux.
… offline docs (#735) * chore(flutter): bump macOS minimum to 12.0, posthog-server to 2.26.0, and add offline queue docs * docs(surveys): fix broken Flutter and Web surveys installation links in PostHogConfig
Resolve the example apps' SwiftPM pins to posthog-ios 4.0.0 and point the native migration guide links at the released 4.0.0 / android-v4.0.0 tags.
Windows and Linux left a legacy properties[$set] in PostHogEvent.properties, so a beforeSend redacting via event.userProperties worked on iOS, macOS and Android but not on desktop. Desktop now moves $set/$set_once into userProperties/userPropertiesSetOnce like the native platforms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts: #736's backedUpQueueLength reads the analytics lane's flushAt, since 6.0 replaced the single _flushAt with per-lane capture v1 queues; the HTTP client keeps its connection timeout. #736's test asserted that SDK debug values win over registered and caller properties, which 6.0 reverses (see "Check property precedence" in MIGRATION.md), so the ported test checks the flushAt threshold and keeps 6.0's precedence.
docs/capabilities.json still mapped the removed Posthog.getFeatureFlagPayload, so generate_markdown_reference.py exits at 6.0.0 and publish.yml (best-effort) would leave the 5.x reference in place for posthog.com. Promote the `next` entries (captureAi, onFeatureFlags) and drop enable/disable. Verified by running the generator with pubspec at 6.0.0: exit 0, no removed APIs. getting-started.md now lists Windows and Linux and the 6.0 requirements. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
PostHog Review · Standard · reviewed 9855b30: 4 Should fix. This pull request is large, so the review ran in 4 parts with less depth than usual.
This is the last automatic review of this pull request. Comment @posthog review to review new changes.
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.
| await for (final chunk in result) { | ||
| response.add(chunk); | ||
| } |
There was a problem hiding this comment.
P2 · Bound response-body forwarding and cancel abandoned upstream requests
When the upstream sends headers and then stalls its body, _forward waits indefinitely: _upstreamTimeout covers only upstream.close(). The SDK times out downstream, but forwarding retains its upstream socket and request buffer; retries accumulate more abandoned connections until reset. Bound body reads and cancel upstream work when the SDK disconnects.
| static Map<String, Object>? _nonNull(Object? map) => map is Map | ||
| ? Map<String, Object>.from(PropertyNormalizer.normalize({ | ||
| for (final MapEntry(:key, :value) in map.entries) '$key': value, | ||
| })) |
There was a problem hiding this comment.
P2 · Preserve property types when copying desktop events
On Windows/Linux, _nonNull now normalizes properties before beforeSend. It converts List<Map<String, dynamic>> into List<Object?>, so hooks casting $exception_list throw and drop exceptions. It also stringifies objects with toJson(), replacing previously supported JSON objects with strings. Deep-copy without changing supported property representations.
| properties: eventProperties, | ||
| userProperties: set, | ||
| userPropertiesSetOnce: setOnce, | ||
| options: preparedOptions == null ? null : {...preparedOptions}, |
There was a problem hiding this comment.
P2 · Deep-copy registered options before invoking callbacks
When registered options contain a nested map or list, this shallow copy retains references to the values in FileStorage. A beforeSend callback editing a nested option therefore changes subsequent events and the cached registration, violating the contract that callback changes affect only their event. Deep-copy the options before exposing them to callbacks.
| if (isUsableProjectToken(config.projectToken)) { | ||
| await platform.configure( | ||
| config, | ||
| host: host, | ||
| superProperties: _readNullableObjectMap(body['super_properties']), | ||
| ); | ||
| } else { | ||
| platform.disable(); |
There was a problem hiding this comment.
P2 · Exercise SDK initialization for fail-open compliance checks
With an empty or phx_ token, /init bypasses SDK setup and disables the adapter itself. The advertised fail_open checks therefore pass without exercising SDK credential validation, hiding regressions that send personal keys or throw during setup. Harness 1.28.0 requires passing these inputs to the SDK; route them through public setup.
On macos-26-arm64 (20261117.0516.1, iOS 26.5 runtime) a new simulator's first boot spends about 4 minutes in CoreLocationMigrator. The last green run took 3m51s and the next two hit the 5-minute timeout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dustinbyrne
left a comment
There was a problem hiding this comment.
AI-assisted review.
Reviewed 9855b3035c0f68abdc72ba87cbe131c667ffd825 (and verified 5e5e58272247256151281d052376ea3810acd285 only raises the iOS simulator boot timeout in .github/workflows/ci.yml), covering native iOS/macOS/Android delegation, the desktop Dart core, web, migration docs, and the compliance adapter.
The v6 architecture, capture v1 / captureAi framing, native bridges, feature flag listener lifecycle, and earlier review fixes (including desktop $set dedup and legacy $set -> userProperties) look solid. One confirmed Breaking regression ($exception_list type erasure dropping $exception events in desktop beforeSend) and two Concern issues (shallow-copied desktop options leaking nested mutations into FileStorage, and the PostHogConfig.disableGeoIp Dartdoc/behavior mismatch under built-event beforeSend) are inline, along with four non-blocking suggestions.
Local Base (78c5a5d0) vs Head (9855b303) regression checks ran against exact Dart SDK source under Flutter 3.35.4 / Dart 3.9.2.
| /// map. Registered properties share their nested maps and lists with | ||
| /// storage, so a callback editing them in place would change later events. | ||
| static Map<String, Object>? _nonNull(Object? map) => map is Map | ||
| ? Map<String, Object>.from(PropertyNormalizer.normalize({ |
There was a problem hiding this comment.
Breaking: On Windows and Linux, PosthogFlutterDesktop._prepare normalizes properties with PropertyNormalizer.normalize twice before beforeSend runs — first via _mergeUserProps -> _normalize (posthog_flutter_desktop.dart:776-784, 889-895) and again in _nonNull (posthog_flutter_desktop.dart:788-790, 810-814). Because PropertyNormalizer._normalizeValue converts every List to List<Object?>, $exception_list loses its List<Map<String, dynamic>> runtime type before hooks see it (and objects with toJson() are stringified before hooks instead of after; wire stringification itself was pre-existing on 5.x).
Contract & comparison: PosthogFlutterIO._valueFromNative (posthog_flutter_io.dart:229-248) and MIGRATION.md:467 explicitly preserve List<Map<String, dynamic>> on iOS, macOS, and Android because callbacks commonly cast $exception_list to List<Map<String, dynamic>>? and a failed cast drops the event. Executed locally against Base (78c5a5d0) vs Head (9855b303): on origin/main, a desktop beforeSend callback casting event.properties?[r'$exception_list'] as List<Map<String, dynamic>>? passed (rawType=List<Map<String, Object?>>, $exception captured and scrubbed); on this PR, the same callback throws type 'List<Object?>' is not a subtype of type 'List<Map<String, dynamic>>?' in type cast and silently drops every $exception event.
Minimal caller:
config.beforeSend = [
(event) {
if (event.event == r'$exception') {
final list = event.properties?[r'$exception_list'] as List<Map<String, dynamic>>?;
list?.first['value'] = 'scrubbed';
}
return event;
},
];
await Posthog().captureException(error: StateError('secret'));Recommendation: Consider deferring PropertyNormalizer.normalize to _captureProcessed (after beforeSend) by removing _normalize from the pre-beforeSend _prepare path (lines 776–784) and replacing PropertyNormalizer.normalize in _nonNull (lines 810–814) with a type-preserving deep copy that strips null map entries, protects FileStorage references, and preserves/reconstructs List<Map<String, dynamic>> for lists of string-keyed maps (like PosthogFlutterIO._valueFromNative). Consider adding a desktop regression test for captureException with a List<Map<String, dynamic>>? cast in beforeSend.
| properties: eventProperties, | ||
| userProperties: set, | ||
| userPropertiesSetOnce: setOnce, | ||
| options: preparedOptions == null ? null : {...preparedOptions}, |
There was a problem hiding this comment.
Concern: PosthogFlutterDesktop._prepare shallow-copies prepared.options ({...preparedOptions} at posthog_flutter_desktop.dart:798), retaining live references to nested Map/List values cached in FileStorage._cache. Unlike properties (which _nonNull deep-copies specifically to prevent storage mutation, lines 807–809), a beforeSend callback mutating a nested registered option in place corrupts the cached registration and leaks into subsequent events.
Impact & reachability: All four currently known capture v1 options are scalars, so this affects only custom/structured options passed to registerOptions() (which Posthog.registerOptions and Posthog.capture explicitly accept as Map<String, Object?> and forward unchanged). Verified locally on 9855b303: registering {'custom': {'tags': ['a']}} and mutating tags.add('mutated') only on 'first' caused 'second' to be sent with tags: ['a', 'mutated'] instead of ['a'].
Recommendation: Consider deep-copying preparedOptions here (reusing the same deep-copy helper used for eventProperties) and adding a regression test in posthog_flutter_desktop_test.dart.
| r'$process_person_profile': _hasPersonProcessing(), | ||
| r'$session_id': managedSessionId, | ||
| r'$is_identified': _isIdentified(), | ||
| if (_disableGeoIp) r'$geoip_disable': true, |
There was a problem hiding this comment.
Concern: PostHogConfig.disableGeoIp (posthog_config.dart:211-212) still guarantees: "The SDK adds the property after [beforeSend] runs, so a callback can't see or remove it." Under v6's built-event beforeSend, $geoip_disable: true is now added before beforeSend on all five non-web platforms (iOS, macOS, Android, Windows, Linux).
Observed Base vs Head comparison: Verified locally on Desktop (and by source inspection on iOS/Android buildEventForWrapper):
- With
config.disableGeoIp = trueand abeforeSendreturningPostHogEvent(event: e.event, properties: {'allowed': 'yes'}, options: e.options): onorigin/main(78c5a5d0),beforeSendsawnulland the wire event carried$geoip_disable: true; on this PR (9855b303),beforeSendseestrueand$geoip_disableis stripped from the wire event (silently re-enabling GeoIP enrichment). - With
config.disableGeoIp = trueand callerproperties: {r'$geoip_disable': false}:origin/mainsenttrue, while9855b303sendsfalseon Desktop (posthog_core.dart:200) and iOS (PostHogSDK.swift:869-871), whereas Android (PostHog.kt:1009-1012) explicitly stamps$geoip_disable = trueafter caller merge.
MIGRATION.md (Review beforeSend callbacks, lines 458–463) warns about dropping process_person_profile: false when replacing event.options, but doesn't warn about $geoip_disable: true when replacing event.properties.
Recommendation: Consider deciding between:
- Documenting the native 4.0 semantics (matching
posthog-ios4.0 andposthog-android4.0, which don't promisebeforeSendcannot see/remove$geoip_disable): updateposthog_config.dart:211-212, add adisableGeoIpcallout inMIGRATION.mdunderReview beforeSend callbacks, and decide whether Desktop (posthog_core.dart:200) should match Android (enforce after caller merge) or iOS (document the divergence / align cross-SDK). - Keeping the Dartdoc privacy guarantee by re-applying
$geoip_disable: trueafterbeforeSendwhenconfig.disableGeoIp == true.
| /// Callbacks can be synchronous or asynchronous (returning | ||
| /// `FutureOr<PostHogEvent?>`). | ||
| typedef BeforeSendCallback = FutureOr<PostHogEvent?> Function( | ||
| /// Callbacks are synchronous, as in the native SDKs, so the event is sent |
There was a problem hiding this comment.
Suggestion: The Dartdoc for BeforeSendCallback (posthog_config.dart:13-14, just above) still says "The [event] argument contains the event name and user-provided properties that are about to be captured", which is stale after v6 switched iOS, macOS, Android, Windows, and Linux to pass the built event (system properties, registered properties, options, uuid, distinctId, timestamp) as documented on PostHogEvent (posthog_event.dart:6-8, 24-31) and PostHogConfig.beforeSend (posthog_config.dart:459-467).
Consider updating lines 13–15 to reflect the built-event contract on non-web platforms (and note that web still passes only user-provided properties) so IDE tooltips and the generated reference stay consistent.
| timeout: lane.timeout); | ||
| if (response.status != 307 && response.status != 308) return response; | ||
| final location = response.location; | ||
| final target = location == null ? null : url.resolve(location); |
There was a problem hiding this comment.
Suggestion: In _fetchCaptureV1 (posthog_core_stateless.dart:972), url.resolve(location) is unguarded. If a proxy returns a 307 or 308 with a malformed Location header (e.g. http://[::1), url.resolve throws FormatException instead of treating the redirect as unfollowable — skipping the redirect warning, leaving lane.pendingIdentity uncleared, and surfacing FormatException instead of PostHogFetchHttpError (unlike the contract at lines 869–870 and 953–956). Verified locally on 9855b303: a 307 with Location: http://[::1 caused DesktopPostHog.flush() to throw FormatException instead of PostHogFetchHttpError.
Consider wrapping url.resolve(location) in a try/on FormatException (falling back to target = null) so malformed redirects take the existing terminal-return path, and adding a test in capture_v1_test.dart.
| } | ||
|
|
||
| await platform.resetAdapterState(); | ||
| if (isUsableProjectToken(config.projectToken)) { |
There was a problem hiding this comment.
Suggestion: In /init (adapter_server.dart:147-155), the compliance adapter calls isUsableProjectToken(config.projectToken) directly and branches to platform.disable(), bypassing Posthog().setup(config). Production Posthog().setup (posthog.dart:77) uses the same helper and is unit-tested in posthog_test.dart:58-72, 164-195, so production behavior is covered — however, the advertised fail_open compliance capability currently validates isUsableProjectToken rather than the public Posthog().setup entry point.
Consider routing /init through Posthog().setup(config) (by binding PosthogFlutterPlatformInterface.instance to the PosthogFlutterDesktop instance and treating created == null as disabled, with Posthog().close() in resetAdapterState()) so compliance runs exercise the real public setup path end-to-end.
| }); | ||
| headersSent = true; | ||
| // Not addStream: a failing body would take the response down with it. | ||
| await for (final chunk in result) { |
There was a problem hiding this comment.
Suggestion: In _RecordingProxy._forward (adapter_server.dart:504-526), _upstreamTimeout bounds waiting for response headers (upstream.close()), but await for (final chunk in result) has no timeout. If the mock server sends headers and then stalls the body, the SDK times out and retries while _forward keeps the upstream connection and buffered request body alive until /reset force-closes _client.
Consider bounding body streaming with result.timeout(_upstreamTimeout) (aborting/closing on timeout or downstream close) so stalled-body scenarios don't accumulate abandoned sockets during compliance runs.
Important
This is the posthog_flutter 6.0 release PR. Don't merge it until every item under "Before release" is done.
publish.ymlreleases on every changeset push tomain, so merging it publishes 6.0.0. "Release day" and "After release" items don't block the merge. Every stacked 6.0 PR is merged into this branch (chore/v6-posthog-ios-4), and the single changeset is.changeset/v6-major-release.md.💡 Motivation and Context
posthog_flutter 6.0 wraps posthog-ios 4.0 and posthog-android 4.0:
/i/v1/analytics/events) on iOS, macOS, Android, Windows and Linux. The newcaptureAi()sends AI events to/i/v1/ai/events. Web keeps posthog-js and doesn't change transport.options,registerOptions(), and one property precedence everywhere: SDK-set, then registered, then event properties, thenbeforeSend.beforeSendis synchronous and runs on the event the native SDK built.onFeatureFlagsbecomes a listener you can unsubscribe, CocoaPods is gone (SPM only), and Flutter 3.41, iOS 15, macOS 12 and Xcode 26 are the new floors.The upgrade guide is
posthog_flutter/MIGRATION.md.Docs and onboarding that ship with this release (merge once 6.0.0 is on pub.dev):
beforeSend, wizard eval rubric. Needs [Waiting on posthog-react-native 5.0.0] feat(docs): replace the React Native SDK pages with their Markdown reference posthog.com#22334 (publishes/docs/libraries/flutter/migrationfromMIGRATION.md) and #21385 (/docs/api/capture-v1) with or before it.^6.0.0).captureAitab pinned to^6.0.0.What gets released
posthog_flutterposthog-iosdependency4.0.0 ..< 5.0.0(SPM only)posthog-androiddependency[3.75.0, 4.0.0)→[4.0.0, 5.0.0), strict (#729)posthog-android5.x fails the build instead of crashing at runtime.Merged into this branch
apiKey,enable/disable,sendFeatureFlagEvents,getFeatureFlagPayload,debouncerDelay,PostHogDataMode.cellular, widget states)enable/disable→optIn/optOut;toMap/fromMapout of the public API;getFeatureFlagResult(sendEvent:)→sendFeatureFlagEvent:getFeatureFlagResult()followsconfig.sendFeatureFlagEvent;isFeatureEnabled(defaultValue:)Posthog().onFeatureFlags()listener withunsubscribe()replacesPostHogConfig.onFeatureFlagscaptureAi. Landed with #678, #679, #681, #682, #686, #688, #690, #698, #699, #701, #703, #704 merged into it (see the landing order in #673)$app_languageuntil posthog-js supports itregisterOptions()/unregisterOptions()process_person_profilekept out of$setdedup; a registered personless setting stays off identity events; docs for identity calls under itposthog-android4.x rangemainis merged in up to 5.61.2 (19ff2be), including #721 (exclude failed Dart flag values on Windows and Linux; its test was adapted to the capture v1 sender), #720 (disableGeoIp), #732 (AGP 9 KGP warning) and #736 ($sdk_debug_pending_queue_sizeonly once the queue reachesflushAt).Release review changes in this PR
2026-11-20
/batchrequests; AI events on/i/v1/ai/events. The 5.61.2 ↔ 6.0 upgrade/rollback check passed on the iOS Simulator and Android: queued events, identity, super properties, cached flags, opt-out and registered options carry over. No physical device this time.build-apple (ios, spm)hit the 5-minute boot timeout twice; raised to 10. Same fix formainin ci: give the iOS test simulator 10 minutes to boot #737.docs/capabilities.jsonstill mapped the removedgetFeatureFlagPayload, so the release's reference generation would have failed and left the 5.x reference for posthog.com. Fixed and verified with the generator at 6.0.0.docs/getting-started.mdlists Windows, Linux and the 6.0 requirements.4.0.0/android-v4.0.0tags. Gradle resolvesposthog-android:4.0.0andposthog:7.0.0from Maven Central; no SNAPSHOT, mavenLocal or branch pins remain. ci: [do not merge] build v6 against unreleased native 4.0 #709 is closed.references/posthog-flutter-migration.mdwith MIGRATION.md (macOS 12.0,posthog-server2.26.0).main(5.61.2). Conflicts: fix: only attach $sdk_debug_pending_queue_size once the queue reaches flushAt #736'sbackedUpQueueLengthreads the analytics lane'sflushAt, since 6.0 has per-lane capture v1 queues. fix: only attach $sdk_debug_pending_queue_size once the queue reaches flushAt #736's test asserted that SDK debug values win over registered and caller properties, which 6.0 reverses (Check property precedence), so the ported test checks theflushAtthreshold and keeps 6.0's precedence.flutter test: 1,594 pass;flutter analyze,dart formatandscripts/check-api-dart.shclean; exampleflutter build apk --debug,flutter build ios --no-codesignandflutter build macos --debugbuild against the released natives.2026-11-17
main(5.61.0, feat: add disableGeoip config #720disableGeoIp). Conflicts: Android keeps the strict[4.0.0, 5.0.0)range and setsPostHogConfig.disableGeoIp, which posthog-android 4.0 has;PostHogConfig.toMap()stays removed anddisableGeoIpgoes throughchannel_serialization.dart; the compliance adapter keeps its capture v1 client path.ci.ymlauto-merged feat: add disableGeoip config #720's simulator boot step gated on thecocoapodsleg, which 6.0 removed, so the iOS plugin tests would have run with an empty simulator id; it now runs on every iOS leg. posthog-ios 4.0 sets$geoip_disableas an event property, like the desktop core.flutter test: 1,593 pass;flutter analyze,dart formatandscripts/check-api-dart.shclean; compliance adapter tests (CI's list): 36 pass; Kotlin plugin tests against a local posthog-android 4.0.0: 84/84, including the threedisableGeoIptests.2026-11-13
main(5.60.3).posthog_core_failed_flags_test.dartfrom fix: exclude failed Dart flag values on Windows and Linux #721 answered every request with a/flagsbody, which the capture v1 sender reads as a 2xx without per-event results, so the Darttest, Linux and Windows jobs failed on the PR merge. It now answers only/flagswith that body.flutter test: 1,587 pass;flutter analyzeandscripts/check-api-dart.shclean.flutter build swift-packageand compiles its Swift package for the iOS simulator (against posthog-ioschore/v4-remove-deprecated). Modules can't target macOS, so the text is iOS only. MIGRATION.md and the changeset no longer say "stay on 5.x"; the same change was applied to posthog.com#20924 and posthog#128557, and suggested on docs: sort the Flutter 6.0.0 migration guide by when you make each change #726.2026-11-05 / 2026-11-06
main(5.60.0).featureFlagRequestMaxRetries(feat(flags): add featureFlagRequestMaxRetries config #702) goes throughchannel_serialization.dart, and the desktop/flagsretry count reads it.beforeSendset,capture,screen,captureExceptionandcaptureAithrewBinding has not yet been initializedbeforeWidgetsFlutterBinding.ensureInitialized()instead of being skipped with a warning. Fixed, regression test extended.nullpayload, iOS empty-variantisFeatureEnabled()).$liband$lib_versionon Windows and Linux capture v1 events, matching posthog-ios#1036 and posthog-android#942.Before release
4.0.0,android-v4.0.0/ core 7.0.0); this branch resolves them. ci: [do not merge] build v6 against unreleased native 4.0 #709 is closed.build-apple,build-android, CodeQL), at 5e5e582.registerOptionsForWrapper, needed by feat: add registerOptions and unregisterOptions #715), #1036/#942 ($lib), #1037/#949 (empty variant) are merged into native 4.0.~/Develop/posthog-flutter-v6-e2e.posthog.com/docs/api/capture-v1, which 404s until then. Not a hard blocker.Release day, after 6.0.0 is on pub.dev
These pin
^6.0.0, so they can't merge earlier.installrubric moves to 6.x in posthog.com#20924, and context-mill picks up the 6.0 docs with its next release (same flow as the Android 4.0 freeze release).surveys/_snippets/flutter-surveys-installation.mdx, which #22334 edits: keep the deletion.After release
$app_language: add a "Most common app language" tile to the Mobile Analytics dashboard template, then close$localecollected different from iOS posthog-android#822 and reply to the reporter. (Taxonomy chore(taxonomy): add $app_language for mobile SDKs posthog#128366 and sdk-specs docs: record posthog_flutter 6.0 surfaces sdk-specs#171 are merged.)compliance/posthog-flutter.mdre-audit for 6.0 (only a "Pending re-audit" note today).Follow-ups found during the review
No blocking issues.
$feature_flag_response: nullon$feature_flag_called(fix: exclude failed Dart flag values on Windows and Linux #721, already in 5.60.3), while iOS, macOS and Android 4.0 leave the key out for a failed or missing flag. Small parity fix for a minor.frontend/src/scenes/feature-flags/FeatureFlagSnippets.tsx:578in the posthog monorepo (remote-config snippet) readsresult.payloadon a nullablePostHogFeatureFlagResult?, which doesn't compile in Dart. Pre-existing, not 6.0-specific.Deliberately excluded
💚 How did you test it?
How to build and test this branch
posthog-ios 4.0.0 and posthog-android 4.0.0 are published, so no native setup is needed.
Run:
Automated
flutter analyze,dart format,scripts/check-api-dart.sh: clean.flutter test: 1,593 VM tests pass (2026-11-17, after the 5.61.0 merge). Chrome tests pass (the 3 app-version tests need theFLUTTER_BUILD_NAMEdefine that CI's Flutter injects).:posthog_flutter:testDebugUnitTest, not run by CI) against posthog-android 4.0: 84/84 (2026-11-17).On devices, against unreleased native 4.0
Native: posthog-ios and posthog-android
chore/v4-remove-deprecated(capture v1 included), wired through a local SPM path package and mavenLocal (version checked in the built APK).1. Scenario suite against a local capture server (58 scenarios,
flutter test integration_test, events checked from the decoded request bodies)What the scenarios cover:
PostHog-Sdk-Infoheader, gzip, rootsession_id/uuid/timestamp$process_person_profileproperty moved into options, options set inbeforeSendcaptureAi: AI endpoint, returned uuid,beforeSenddrop returnsnull;capture('$ai_…')stays on analytics$localeand$app_language: normalization (pt_BR→pt-BR), kept acrossreset(), cleared bysetAppLanguage(null)onFeatureFlags: loads,unsubscribe()reloadFeatureFlags(): result, anderrorsLoadingwith last-known flags on a 502isFeatureEnabled(defaultValue:): only for unknown flagsgetFeatureFlagResult:$feature_flag_calledby default,sendFeatureFlagEvent: false,config.sendFeatureFlagEvent = falsewith per-call override, JSON payload, malformed payload →nullfeatureFlagRequestMaxRetries: 0, default and 3 (1, 2 and 4/flagsrequests against a 502, with exponential backoff)beforeSend: the 38 scenarios from the feat!: make beforeSend callbacks synchronous #686/fix: keep events and user properties through beforeSend #698 work, now on the final API:reset/identify/alias/group/register/optOutreset,optOut,setup,identifyclose()/setup()right after a captureidentify→$identifywith$set,group→$groupidentify,optOut/isOptOut/optIn,setPersonPropertiesForFlagsreaching/flags, exception steps,getAllFeatureFlags, logs on/i/v1/logs.Measurements were identical on Android and iOS for retries,
defaultValueand payloads. A synccapture()hand-off took 10–154 µs.2. The example app against real PostHog Cloud (project 381971, through a recording forward proxy, so each request's real response was checked)
okApplication OpenedokokEvents included lifecycle,
$screen, custom events,$identify,$create_alias,$groupidentify,$exception,$feature_flag_called, and thebeforeSend"modify me" event. The dropped "drop me" event never left the device.Not tested on a device
📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
main, bumped the compliance harness, fixed one bug, completed the docs and ran the device tests above. The 2026-11-13 review mergedmain(5.60.3), updated the add-to-app guidance for Flutter 3.50 and reviewed the docs PRs. The device test harness isn't committed.🤖 Generated with Claude Code