Skip to content

chore!: rename platform enable/disable to optIn/optOut - #645

Merged
turnipdabeets merged 3 commits into
chore/v6-posthog-ios-4from
chore/v6-platform-opt-in-out
Oct 7, 2026
Merged

turnipdabeets merged 3 commits into
chore/v6-posthog-ios-4from
chore/v6-platform-opt-in-out

Conversation

@turnipdabeets

@turnipdabeets turnipdabeets commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

💡 Motivation and Context

Finishes the enable()/disable() → optIn()/optOut() rename from #636/#638 at the platform layer. The public Posthog() API already uses optIn()/optOut(), but PosthogFlutterPlatformInterface (and its IO/web implementations) still exposed enable()/disable(). Both classes are in the public API snapshot, so this is a hard rename for v6 with no deprecation shims.

Breaking for code that calls these methods directly on PosthogFlutterPlatformInterface, PosthogFlutterIO or PosthogFlutterWeb, and for custom implementations and test fakes/mocks that override them; app code calling Posthog().optIn()/optOut() is unaffected.

Method-channel names are unchanged. PosthogFlutterIO still invokes 'enable'/'disable' on the method channel, and PosthogFlutterWeb still dispatches MethodCall('enable'/'disable') to the web handler. Renaming the wire strings would mean touching the Kotlin and Swift handlers and the web handler for no user-visible benefit, so this PR stays Dart-API-only.

Stacked on #637.

💚 How did you test it?

  • flutter analyze: no issues
  • flutter test: all 781 tests pass
  • dart format --set-exit-if-changed: clean
  • Regenerated api/posthog_flutter.api.json with scripts/check-api-dart.sh --update

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

Claude Code renamed the methods, updated the test fake, regenerated the API snapshot, and added a major changeset. The decision to leave the native/web channel method strings alone was made to keep the change Dart-only.

🤖 Generated with Claude Code

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>
@turnipdabeets turnipdabeets self-assigned this Oct 7, 2026
@turnipdabeets
turnipdabeets marked this pull request as ready for review October 7, 2026 15:53
@turnipdabeets
turnipdabeets requested a review from a team as a code owner October 7, 2026 15:53
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

posthog-flutter Compliance Report

Date: 2026-10-07 18:26:48 UTC
Duration: 96545ms

✅ All Tests Passed!

45/45 tests passed


Capture Tests

✅ 29/29 tests passed

View Details
Test Status Duration
Format Validation.Event Has Required Fields ✅ 128ms
Format Validation.Event Has Uuid ✅ 118ms
Format Validation.Event Has Lib Properties ✅ 111ms
Format Validation.Distinct Id Is String ✅ 112ms
Format Validation.Token Is Present ✅ 113ms
Format Validation.Custom Properties Preserved ✅ 112ms
Format Validation.Event Has Timestamp ✅ 113ms
Retry Behavior.Retries On 503 ✅ 5326ms
Retry Behavior.Does Not Retry On 400 ✅ 2114ms
Retry Behavior.Does Not Retry On 401 ✅ 2116ms
Retry Behavior.Respects Retry After Header ✅ 8115ms
Retry Behavior.Implements Backoff ✅ 15441ms
Retry Behavior.Retries On 500 ✅ 5217ms
Retry Behavior.Retries On 502 ✅ 5220ms
Retry Behavior.Retries On 504 ✅ 5223ms
Retry Behavior.Max Retries Respected ✅ 15442ms
Deduplication.Generates Unique Uuids ✅ 124ms
Deduplication.Preserves Uuid On Retry ✅ 5223ms
Deduplication.Preserves Uuid And Timestamp On Retry ✅ 10331ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry ✅ 5224ms
Deduplication.No Duplicate Events In Batch ✅ 117ms
Deduplication.Different Events Have Different Uuids ✅ 114ms
Compression.Sends Gzip When Enabled ✅ 112ms
Batch Format.Uses Proper Batch Structure ✅ 112ms
Batch Format.Flush With No Events Sends Nothing ✅ 107ms
Batch Format.Multiple Events Batched Together ✅ 119ms
Error Handling.Does Not Retry On 403 ✅ 2113ms
Error Handling.Does Not Retry On 413 ✅ 2114ms
Error Handling.Retries On 408 ✅ 5221ms

Feature_Flags Tests

✅ 16/16 tests passed

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

@dustinbyrne dustinbyrne 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.

The platform rename is consistent across the interface, implementations, and wrapper, with transport and lifecycle behavior preserved. Approving with one non-blocking changeset wording correction below. The Apple dependency failure is also present on the base stack.

AI-assisted review.

Comment thread .changeset/v6-platform-opt-in-out.md Outdated
@turnipdabeets
turnipdabeets merged commit 04507fe into chore/v6-posthog-ios-4 Oct 7, 2026
9 checks passed
@turnipdabeets
turnipdabeets deleted the chore/v6-platform-opt-in-out branch October 7, 2026 18:22
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
* 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.

2 participants