Repository navigation
Conversation
There was a problem hiding this comment.
PostHog Review · Standard · reviewed 9070c4a: 1 Should fix.
This is the only automatic review while this pull request is a draft. Comment @posthog review to review new changes sooner. Otherwise, a review of the new changes runs when you mark it ready for review.
See this review and its findings in PostHog Review. Comment @posthog review --deep for a Deep review. A Deep review takes longer and looks deeper than a Standard review.
posthog-flutter Compliance ReportDate: 2026-10-30 14:40:56 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.
Shape looks right: double? with a null default matches Android, and the key being left out means native screens pick up the new default while Flutter frames stay the same. Re-ran the three replay/snapshot test files at this head and they pass. Native-screen path has not had a device run yet, not blocking from my side.
| @@ -0,0 +1,5 @@ | |||
| --- | |||
| "posthog_flutter": minor | |||
There was a problem hiding this comment.
[suggestion] I would keep this as a minor, same as Android: the option is @experimental, only a few weeks old, and only code reading the getter breaks. RELEASING.md has no experimental exception though, so could you reply on the bot thread with that reasoning so the call is on record?
| "posthog_flutter": minor | ||
| --- | ||
|
|
||
| **Breaking:** Change `PostHogSessionReplayConfig.screenshotScale` from `double` to `double?` with a `null` default, so native screens recorded with `captureNativeScreens` on Android pick up posthog-android's one-pixel-per-dp default instead of physical resolution. Flutter screens still capture at one pixel per logical pixel. Set `screenshotScale: 1.0` to keep native screens at physical resolution. Code that reads the value into a `double` needs a null check. |
There was a problem hiding this comment.
[nit] screenshotScale: 1.0 reads like a named parameter, but this is a property, so screenshotScale = 1.0?
| testImplementation 'junit:junit:4.13.2' | ||
| testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.10.1' | ||
| implementation 'com.posthog:posthog-android:[3.72.9,4.0.0)' | ||
| implementation 'com.posthog:posthog-android:[3.74.0,4.0.0)' |
There was a problem hiding this comment.
[nit] Worth making the floor 3.74.2 to match React Native? It picks up the masking fixes for anyone on a lockfile. Fresh builds already resolve to it through the open range, so fine to skip.
💡 Motivation and Context
Follow-up to PostHog/posthog-android#906, released as posthog-android 3.74.0. That change made
sessionReplayConfig.screenshotScalenullable on Android, withnullas the default meaning one pixel per dp instead of native resolution.Flutter screens were already fine:
screenshot_capturer.dartcaptures them in Dart at one pixel per logical pixel. Native screens recorded withcaptureNativeScreensdidn't get the new default though, because the Dart option defaulted to1.0and was always sent over the method channel, which pinned them to physical resolution.Public API change:
PostHogSessionReplayConfig.screenshotScalechanges fromdoubletodouble?.nullis the new default and is not sent to the native SDK, so native screens pick up posthog-android's one-pixel-per-dp default. Flutter screens still capture at1.0.0.1–1.0.screenshotScale = 1.0keeps native screens at physical resolution.nullinstead of1.0.doubleneeds a null check.The option is
@experimentaland posthog-android shipped the same type change as a minor, so I went with a minor here too and flagged the breaking type change in the changeset. Happy to make it a major if anyone feels otherwise.Also bumps the posthog-android floor to
[3.74.0,4.0.0). The Kotlin plugin already only setsscreenshotScalewhen the key is present (PosthogFlutterPlugin.kt:662), so no plugin change was needed.iOS doesn't read
screenshotScaleon Flutter, so this is Android only. No sdk-spec covers screenshot scale.💚 How did you test it?
flutter testonreplay_screenshot_config_test.dart,replay_screenshot_capture_test.dartandevent_shape_snapshot_test.dart: 23 pass. New cases cover the default not being sent, an explicit1.0being sent, NaN/infinity/null resetting tonull, and anullscale producing the same Flutter frame as1.0../gradlew :posthog_flutter:testDebugUnitTestagainst 3.74.0: 61 pass, includingsetup_screenshotControls_preserveDefaultsnow assertingnullwhen the key is absent.make analyzeDart,make checkFormatDart,make updateApiDart(the snapshot changes one line,doubletodouble?).📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset file🤖 Agent context
DRI: @ioannisj
Autonomy: Human-driven (agent-assisted)