Skip to content

chore!: remove 5.x-deprecated names for v6 - #638

Merged
turnipdabeets merged 1 commit into
chore/v6-posthog-ios-4from
chore/v6-remove-5x-deprecations
Oct 7, 2026
Merged

turnipdabeets merged 1 commit into
chore/v6-posthog-ios-4from
chore/v6-remove-5x-deprecations

Conversation

@turnipdabeets

@turnipdabeets turnipdabeets commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

💡 Motivation and Context

Stacked on #637 (v6 base). This removes the APIs that 5.x deprecates:

Removed Use instead Deprecated in
Posthog().enable() / disable() optIn() / optOut() #636
PostHogConfig.sendFeatureFlagEvents sendFeatureFlagEvent #636

Commits:

  1. A cherry-pick of feat: add optIn/optOut and sendFeatureFlagEvent, deprecate old names #636, so this branch builds on its own. It drops out on rebase once feat: add optIn/optOut and sendFeatureFlagEvent, deprecate old names #636 merges into main.
  2. Remove the deprecated names. The internal setup key sent to native is unchanged, so there are no Kotlin or Swift changes.

Merge order: #636 into main → rebase #637 → this PR.

💚 How did you test it?

  • flutter analyze: no issues, for the plugin and for the example app
  • flutter test: 781 pass
  • dart format --set-exit-if-changed: clean
  • scripts/check-api-dart.sh: snapshot updated per commit

📝 Checklist

  • 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)

  • Made with Claude Code.
  • PostHogWidgetState and PostHogMaskWidgetState aren't touched here. chore: make PostHogWidgetState and PostHogMaskWidgetState internal #635 already marks them @internal and hides them from the export, so making them private would only be tidying.
  • I kept the TRACK_APPLICATION_LIFECYCLE_EVENTS fallback and getFeatureFlagResult(sendEvent:) out on purpose. The fallback was never deprecated, and sendEvent already matches posthog-js / React Native.

🤖 Generated with Claude Code

@turnipdabeets turnipdabeets self-assigned this Oct 3, 2026
@greptile-apps

greptile-apps Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Retrigger

[High risk] Removes deprecated API names across the SDK.

This PR appears safe to merge as an intentional v6 breaking change.

Reviews (1) · Last reviewed commit: "chore!: remove enable/disable and sendFe..."

@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

posthog-flutter Compliance Report

Date: 2026-10-07 00:36:09 UTC
Duration: 96817ms

✅ All Tests Passed!

45/45 tests passed


Capture Tests

✅ 29/29 tests passed

View Details
Test Status Duration
Format Validation.Event Has Required Fields ✅ 141ms
Format Validation.Event Has Uuid ✅ 124ms
Format Validation.Event Has Lib Properties ✅ 117ms
Format Validation.Distinct Id Is String ✅ 115ms
Format Validation.Token Is Present ✅ 114ms
Format Validation.Custom Properties Preserved ✅ 117ms
Format Validation.Event Has Timestamp ✅ 118ms
Retry Behavior.Retries On 503 ✅ 5332ms
Retry Behavior.Does Not Retry On 400 ✅ 2119ms
Retry Behavior.Does Not Retry On 401 ✅ 2117ms
Retry Behavior.Respects Retry After Header ✅ 8123ms
Retry Behavior.Implements Backoff ✅ 15435ms
Retry Behavior.Retries On 500 ✅ 5227ms
Retry Behavior.Retries On 502 ✅ 5227ms
Retry Behavior.Retries On 504 ✅ 5225ms
Retry Behavior.Max Retries Respected ✅ 15447ms
Deduplication.Generates Unique Uuids ✅ 122ms
Deduplication.Preserves Uuid On Retry ✅ 5223ms
Deduplication.Preserves Uuid And Timestamp On Retry ✅ 10336ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry ✅ 5232ms
Deduplication.No Duplicate Events In Batch ✅ 123ms
Deduplication.Different Events Have Different Uuids ✅ 117ms
Compression.Sends Gzip When Enabled ✅ 117ms
Batch Format.Uses Proper Batch Structure ✅ 114ms
Batch Format.Flush With No Events Sends Nothing ✅ 109ms
Batch Format.Multiple Events Batched Together ✅ 124ms
Error Handling.Does Not Retry On 403 ✅ 2117ms
Error Handling.Does Not Retry On 413 ✅ 2118ms
Error Handling.Retries On 408 ✅ 5224ms

Feature_Flags Tests

✅ 16/16 tests passed

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

@turnipdabeets
turnipdabeets force-pushed the chore/v6-remove-5x-deprecations branch from fc1a4c3 to 08a61e2 Compare October 5, 2026 15:51
@turnipdabeets
turnipdabeets force-pushed the chore/v6-posthog-ios-4 branch 3 times, most recently from b996dea to 047d564 Compare October 5, 2026 17:19
@turnipdabeets
turnipdabeets force-pushed the chore/v6-remove-5x-deprecations branch from 08a61e2 to 1a5ba2f Compare October 5, 2026 18:00
@turnipdabeets

Copy link
Copy Markdown
Contributor Author

@ioannisj thoughts on this?

@ioannisj

ioannisj commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

@ioannisj thoughts on this?

I think this makes sense. Naming aligns with other SDKs right? My only thought is that #636 should prob go out soon so that people will get a chance to see the deprecations

@turnipdabeets
turnipdabeets marked this pull request as ready for review October 6, 2026 22:09
@turnipdabeets
turnipdabeets requested a review from a team as a code owner October 6, 2026 22:09
Comment on lines +2 to +6
"posthog_flutter": minor
---

- Add `Posthog().optIn()` and `Posthog().optOut()`, and deprecate `enable()` and `disable()`
- Add `PostHogConfig.sendFeatureFlagEvent`, and deprecate `sendFeatureFlagEvents`

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.

seems somewhat confusing to deprecate as minor and remove as major within a single change. depending on where i'm looking at the changelog i'll be getting different information about enable(), disable(), sendFeatureFlagEvents

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yea, that changeset was from #636, which has now shipped in 5.51.0. Rebasing the v6 stack on main removed changeset.

Removes the names deprecated in 5.x in favor of optIn/optOut and
sendFeatureFlagEvent.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@turnipdabeets
turnipdabeets force-pushed the chore/v6-posthog-ios-4 branch from 0ae4f04 to 9279d41 Compare October 7, 2026 00:31
@turnipdabeets
turnipdabeets force-pushed the chore/v6-remove-5x-deprecations branch from 1a5ba2f to 61ca95d Compare October 7, 2026 00:31
@turnipdabeets
turnipdabeets merged commit 90664ef into chore/v6-posthog-ios-4 Oct 7, 2026
22 of 38 checks passed
@turnipdabeets
turnipdabeets deleted the chore/v6-remove-5x-deprecations branch October 7, 2026 00:35
turnipdabeets added a commit that referenced this pull request Oct 7, 2026
* chore!: rename platform enable/disable to optIn/optOut

PosthogFlutterPlatformInterface.enable()/disable() become optIn()/optOut()
to match the public Posthog API renamed in #636/#638. The method-channel
names sent to native stay 'enable'/'disable'.

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

* docs(changeset): cover direct platform callers in the opt-in/out rename

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

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
turnipdabeets added a commit that referenced this pull request Oct 7, 2026
Removes the names deprecated in 5.x in favor of optIn/optOut and
sendFeatureFlagEvent.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
turnipdabeets added a commit that referenced this pull request Oct 7, 2026
* chore!: rename platform enable/disable to optIn/optOut

PosthogFlutterPlatformInterface.enable()/disable() become optIn()/optOut()
to match the public Posthog API renamed in #636/#638. The method-channel
names sent to native stay 'enable'/'disable'.

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

* docs(changeset): cover direct platform callers in the opt-in/out rename

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

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@turnipdabeets turnipdabeets mentioned this pull request Oct 7, 2026
5 tasks done
turnipdabeets added a commit that referenced this pull request Oct 8, 2026
Removes the names deprecated in 5.x in favor of optIn/optOut and
sendFeatureFlagEvent.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
turnipdabeets added a commit that referenced this pull request Oct 8, 2026
* chore!: rename platform enable/disable to optIn/optOut

PosthogFlutterPlatformInterface.enable()/disable() become optIn()/optOut()
to match the public Posthog API renamed in #636/#638. The method-channel
names sent to native stay 'enable'/'disable'.

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

* docs(changeset): cover direct platform callers in the opt-in/out rename

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

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants