Skip to content

chore: adapt to posthog-ios 4.0 reloadFeatureFlags callback - #643

Merged
turnipdabeets merged 1 commit into
chore/v6-posthog-ios-4from
chore/v6-reload-flags-result
Oct 7, 2026
Merged

turnipdabeets merged 1 commit into
chore/v6-posthog-ios-4from
chore/v6-reload-flags-result

Conversation

@turnipdabeets

@turnipdabeets turnipdabeets commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

💡 Motivation and Context

Companion to PostHog/posthog-ios#913, stacked on #637. Spec: PostHog/sdk-specs#99.

posthog-ios 4.0 passes a PostHogFeatureFlagsLoaded to the reloadFeatureFlags(_:) callback, so the existing zero-argument closure no longer compiles. This changes it to { _ in ... }. Behavior is unchanged: the Dart Future still resolves once the native reload finishes.

Exposing errorsLoading to Dart is left for a follow-up; reloadFeatureFlags() stays Future<void>.

💚 How did you test it?

  • Not built locally: the plugin requires posthog-ios >= 4.0.0, which isn't released yet. The posthog-ios side compiles with this closure shape (make buildSdk on #913).

📝 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

No changeset: internal change with no Dart API impact; it ships with #637.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

  • Written with Claude Code (Opus 5.5). One-line mechanical change to follow the posthog-ios 4.0 signature.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

posthog-flutter Compliance Report

Date: 2026-10-07 00:36:02 UTC
Duration: 96728ms

✅ All Tests Passed!

45/45 tests passed


Capture Tests

✅ 29/29 tests passed

View Details
Test Status Duration
Format Validation.Event Has Required Fields ✅ 137ms
Format Validation.Event Has Uuid ✅ 117ms
Format Validation.Event Has Lib Properties ✅ 115ms
Format Validation.Distinct Id Is String ✅ 114ms
Format Validation.Token Is Present ✅ 116ms
Format Validation.Custom Properties Preserved ✅ 116ms
Format Validation.Event Has Timestamp ✅ 115ms
Retry Behavior.Retries On 503 ✅ 5331ms
Retry Behavior.Does Not Retry On 400 ✅ 2117ms
Retry Behavior.Does Not Retry On 401 ✅ 2118ms
Retry Behavior.Respects Retry After Header ✅ 8125ms
Retry Behavior.Implements Backoff ✅ 15434ms
Retry Behavior.Retries On 500 ✅ 5224ms
Retry Behavior.Retries On 502 ✅ 5226ms
Retry Behavior.Retries On 504 ✅ 5224ms
Retry Behavior.Max Retries Respected ✅ 15446ms
Deduplication.Generates Unique Uuids ✅ 122ms
Deduplication.Preserves Uuid On Retry ✅ 5225ms
Deduplication.Preserves Uuid And Timestamp On Retry ✅ 10335ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry ✅ 5230ms
Deduplication.No Duplicate Events In Batch ✅ 122ms
Deduplication.Different Events Have Different Uuids ✅ 116ms
Compression.Sends Gzip When Enabled ✅ 116ms
Batch Format.Uses Proper Batch Structure ✅ 113ms
Batch Format.Flush With No Events Sends Nothing ✅ 109ms
Batch Format.Multiple Events Batched Together ✅ 123ms
Error Handling.Does Not Retry On 403 ✅ 2115ms
Error Handling.Does Not Retry On 413 ✅ 2119ms
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 ✅ 13ms
Request Payload.Flags Request Uses V2 Query Param ✅ 9ms
Request Payload.Flags Request Hits Flags Path Not Decide ✅ 9ms
Request Payload.Flags Request Omits Authorization Header ✅ 9ms
Request Payload.Token In Flags Body Matches Init ✅ 8ms
Request Payload.Groups Round Trip ✅ 9ms
Request Payload.Groups Default To Empty Object ✅ 8ms
Request Payload.Person Properties Distinct Id Auto Populated When Caller Omits It ✅ 9ms
Request Payload.Disable Geoip False Propagates As Geoip Disable False ✅ 8ms
Request Payload.Disable Geoip Omitted Defaults To False ✅ 8ms
Request Payload.Flag Keys To Evaluate Contains Only Requested Key ✅ 9ms
Request Lifecycle.No Flags Request On Init Alone ✅ 3ms
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 ✅ 115ms

posthog-ios 4.0 passes a PostHogFeatureFlagsLoaded to the
reloadFeatureFlags(_:) callback (PostHog/posthog-ios#913).

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-reload-flags-result branch from 8b78004 to 00aa00a Compare October 7, 2026 00:31
@turnipdabeets
turnipdabeets merged commit f5765e0 into chore/v6-posthog-ios-4 Oct 7, 2026
22 of 38 checks passed
@turnipdabeets
turnipdabeets deleted the chore/v6-reload-flags-result branch October 7, 2026 00:35
@turnipdabeets turnipdabeets mentioned this pull request Oct 7, 2026
3 of 5 tasks
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