Repository navigation
Conversation
posthog-flutter Compliance ReportDate: 2026-11-20 20:21:55 UTC ✅ All Tests Passed!45/45 tests passed Capture Tests✅ 29/29 tests passed View Details
Feature_Flags Tests✅ 16/16 tests passed View Details
|
turnipdabeets
left a comment
There was a problem hiding this comment.
Thanks, this matches the spec: the duration key is banned everywhere, and Windows/Linux don't ship replay so session start isn't owed either. Queue size staying is right too.
[nit] posthog_core.dart:147-148: the comment "it may start a new session, which the debug properties below then describe" is stale now that no debug property describes the session. Fine to just drop those two lines.
| } | ||
| expect(queuedProps(storage, 0)[r'$sdk_debug_pending_queue_size'], 0); | ||
| expect(queuedProps(storage, 1)[r'$sdk_debug_pending_queue_size'], 1, | ||
| reason: 'SDK debug values win over a registered super property'); |
There was a problem hiding this comment.
[suggestion] Not from this PR, but the spec says it the other way round: a registered super property overrides the SDK's $sdk_debug_* value, and a caller-supplied one overrides both (session-replay-debug-properties/spec.md, "Caller-supplied event properties take precedence"). _enrichProperties writes the queue size after ...props, so ours wins. Moving it ahead of ...props and flipping this assertion would line it up. Happy for that to be a follow-up if you'd rather keep this one small.
There was a problem hiding this comment.
Yeah you're right, _enrichProperties writes $sdk_debug_pending_queue_size last so it beats both super and caller props. posthog-js does the same today, and so do posthog-ios and posthog-android 3.x. The reorder (PostHog/sdk-specs#143 and #155) ships with the capture v1 majors, and v6 already has it in the Dart core (#637), so I'll leave 5.x as is rather than have desktop diverge from the native SDKs.
|
Dropped the stale comment in 243a9c4. |
…-keys-when-off # Conflicts: # posthog_flutter/lib/src/core/posthog_core.dart # posthog_flutter/test/core/posthog_core_test.dart

💡 Motivation and Context
On Windows and Linux the Dart core adds
$sdk_debug_session_startand$sdk_debug_current_session_durationto every event (posthog_flutter/lib/src/core/posthog_core.dart). Those platforms have no session replay, so replay is always off there. The spec says an SDK with replay intentionally off sends only$recording_status: disabledfrom the replay debug keys, and no SDK sends the duration key at all. posthog-js does the same: with replay off it sends only$recording_status.Spec: PostHog/sdk-specs#232 (posthog-flutter compliance note n28).
Removes both keys from the Dart core.
$sdk_debug_pending_queue_sizestays, and it still wins over a registered super property. iOS, macOS, Android and web are unchanged.💚 How did you test it?
posthog_flutter/test/core/posthog_core_test.dart: both keys are absent on custom events, and the queue size is still0, then1over a registered value.posthog_flutter/test/posthog_flutter_desktop_test.dart:$identifyand a custom event carry$recording_status: disabledand neither key.flutter testinposthog_flutterpasses, anddart analyzeanddart formatare clean.📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset file🤖 Agent context
DRI: @ioannisj
Autonomy: Human-driven (agent-assisted)