Repository navigation
chore!: Flutter Major Release v6 - #637
turnipdabeets wants to merge 59 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-13T23:32:45.446221+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 |
#716) * fix(desktop): keep false-like process_person_profile out of $set dedup Capture reads 'no', 'false', 'off', 0 and 0.0 as false, so a $set sent with one of them is personless. The desktop core only recognised boolean false, cached that event's hash, and dropped the next identical setPersonProperties as a duplicate, losing the profile update. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(desktop): clear the $set dedup hash for non-boolean person processing Capture reads strings and numbers such as 'yes' or 'no' either way, so a $set sent with one leaves the profile's state unknown. Keeping the old hash dropped a later revert to that value; clear it instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…ty layer Another library's $lib no longer gets posthog-flutter's version, and a $lib_version without $lib is replaced, per sdk-specs#146 and matching posthog-ios#1050 and posthog-android#956. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in #652 (keep the Android surveys delegate across repeated setup) and the 5.60.1 release. PosthogFlutterPlugin.kt keeps both sides: v6's feature flags subscription field and unsubscribe on detach, plus main's engine lifecycle listener and surveys delegate detach. Claude-Session: https://claude.ai/code/session_019xLynttdFZAHfqTem5BhPQ
…v6-native-4-prerelease Picks up #637's latest, including its merge of main. No conflicts. Claude-Session: https://claude.ai/code/session_019xLynttdFZAHfqTem5BhPQ
…he 6.0 guide Make the $lib/$lib_version pair rule platform-wide now that iOS #1050 and Android #956 fill the pair, widen the missing-flag $feature_flag_response change to iOS and macOS, document null handling on iOS/macOS/Android, how an empty distinct ID from Dart vs native beforeSend behaves, and rolling back to 5.x. Claude-Session: https://claude.ai/code/session_019xLynttdFZAHfqTem5BhPQ
…etting (#718) * docs: show how to keep identity calls under a registered personless setting Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: point registered personless users to identifiedOnly and note billing --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Anna Garcia <anna.g@posthog.com>
) * docs: generate the Flutter SDK reference for 5.x Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * docs: generate the Flutter SDK reference for the 6.x experimental major Generated from feat/v6-desktop-capture-v1 (#637 and #673) with the capability tags applied. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * docs: regenerate the Flutter references from dart doc The 6.x page comes from chore/v6-posthog-ios-4 (the 6.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 Flutter references with code braces and clean signatures Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: regenerate the Flutter 6.x reference with Capture AI and On feature flags Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: add the Flutter 5.x to 6.0 migration page Built from posthog_flutter/MIGRATION.md on chore/v6-posthog-ios-4 (#637), the way the generator builds it once that guide is on main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: regenerate the Flutter migration page from the current 6.0 guide Rebuilt from posthog_flutter/MIGRATION.md on chore/v6-posthog-ios-4, which now notes the beforeSend option loss on native and the new flag and event fields. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: regenerate the Flutter references Member headings show their names again, and the 6.x and migration pages are rebuilt from the current chore/v6-posthog-ios-4. 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>
# Conflicts: # posthog_flutter/lib/posthog_flutter_web.dart # posthog_flutter/lib/src/posthog_flutter_web_handler.dart # posthog_flutter/test/web_before_send_test.dart # pubspec.lock
…file false A $set sent with process_person_profile: false kept the stored hash, so reverting to the previous properties was dropped as a duplicate. Clear it for every value other than missing or true, per PostHog/sdk-specs#208 and posthog-ios 4.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ecklist posthog-android 4.0 shares the 3.x queue folder and keeps options on the queued event, so a rollback loses them on Android as on iOS. Add the pre-upgrade steps the guide asks for to the checklist, give the posthog-ios 2.x queue note its own heading, and split run-on paragraphs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
….x rollback Verified on the iOS simulator and the Android emulator: AI events 6.0 queued stay on the device while 5.x runs and are sent once the app is on 6.x again, and options registered with registerOptions() return with it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
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 11 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 mobile SDK releases] feat(docs): replace the mobile SDK pages with their Markdown references 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.60.3 (0cbea71), including #721 (exclude failed Dart flag values on Windows and Linux). Its new test was adapted to the capture v1 sender.Release review changes in this PR
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
build-apple,build-androidand CodeQL must go green; they're red now only because4.0.0 ..< 5.0.0/[4.0.0, 5.0.0)don't resolve. Then close ci: [do not merge] build v6 against unreleased native 4.0 #709.registerOptionsForWrapper, needed by feat: add registerOptions and unregisterOptions #715), #1036/#942 ($lib), #1037/#949 (empty variant) are merged into native 4.0.chore/v4-remove-deprecatedbranches). The harness is in~/Develop/posthog-flutter-v6-e2e.posthog.com/docs/api/capture-v1, which 404s until then. Not a hard blocker.feat/v6-desktop-capture-v1: chore!: adopt posthog-ios 4.0 and posthog-android 4.0 #649, feat: add an onFeatureFlags listener you can unsubscribe #670, fix: retry desktop capture v1 requests that get 404 or 429 #678, feat(desktop): captureAi on the AI endpoint, native property order and options passthrough #679, fix(desktop): skip phx_ keys, keep response bodies out of logs, count duplicate copies #681, feat!: run beforeSend on the native-built event on iOS, macOS and Android #682, feat!: make beforeSend callbacks synchronous #686, perf(desktop): move queue file work and request compression off the UI isolate #688, ci: run the capture v1 compliance suites against the real desktop client #690, feat!: report the device language as $locale and add $app_language #699, docs: link the capture v1 upgrade guide and cover capture v1 on every platform #701, fix: send events with a lone surrogate on Windows and Linux #703, fix(desktop): resend a capture v1 retry alone to keep its request identity #704.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 (native 4.0 isn't published yet)
build-apple,build-androidand CodeQL fail on this PR only because posthog-ios 4.0 and posthog-android 4.0 aren't released. #709 runs this branch's CI against the unreleased native branches, and every check passes there. To build or test locally, point the branch at the same native branches. Verified 2026-11-06 at c5a7956 (iOS simulator, macOS and Android debug builds); the 2026-11-13 changes are amainmerge, one test and docs. Don't commit any of this.iOS / macOS: in
posthog_flutter/darwin/posthog_flutter/Package.swift, change the posthog-ios dependency to:Xcode re-resolves the example's
Package.resolvedto the branch by itself.Android: publish posthog-android 4.0 to mavenLocal:
Then add
mavenLocal()as the first entry ofallprojects { repositories { … } }inexample/android/build.gradle.kts.Gradle resolves
[4.0.0, 5.0.0)to the highest 4.x in~/.m2, so delete any othercom/posthog/posthog-android/4.*versions there first. To check, run./gradlew :app:dependencies --configuration debugRuntimeClasspath | grep com.posthogfromexample/android. It should printposthog-android:[4.0.0,5.0.0) -> 4.0.0.Run:
Automated
flutter analyze,dart format,scripts/check-api-dart.sh: clean.flutter test: 1,587 VM tests pass (2026-11-13, after the 5.60.3 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: 67/67.chore/v4-remove-deprecated: green. Its Android job was fixed today (signing on mavenLocal publish, repositories), see ci: [do not merge] build v6 against unreleased native 4.0 #709.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