You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cross-reference to PostHog/posthog-android#750 (filed alongside this): on Android 15+ ARR panels, screenshot capture firing mid-scroll flips the SurfaceFlinger frame-rate vote and causes visible scroll jank; deterministic A/B measurements and a proposed SDK-side fix (defer capture while a pointer is down) are over there.
RN-specific asks:
The RN bridge force-enables screenshot mode (PosthogReactNativePluginModule sets screenshot = true), so RN Android users can't opt into wireframe mode (React Native session replay should allow wireframe mode #3796) — capture-cost fixes are the only path for RN.
Whatever option lands in posthog-android (gesture deferral and/or an Android background-capture mode) — please plumb it through sessionReplayConfig the way feat: add support for background capture for session replay #3552 did for the iOS-only screenshotModeBackgroundCapture.
Context: posthog-react-native 4.66.2, @posthog/react-native-plugin 2.5.1, RN 0.84.1 new arch. Our interim app-side workaround (pause/resume recording around gestures via stopSessionRecording()/startSessionRecording(true)) restores the no-replay jank baseline while keeping recordings — happy to share details.
Conclusion: Valid React Native Android session-replay enhancement, but it is blocked on a concrete posthog-android API for gesture-aware/background screenshot capture. Confidence: 94% Suggested labels:react-native, Android, feature/replay, enhancement, team/client-libraries
Thanks — the RN-side limitation is confirmed. The Android bridge currently unconditionally sets sessionReplayConfig.screenshot = true, so RN consumers cannot select wireframe mode. The existing screenshotModeBackgroundCapture setting is intentionally iOS-only: it is already passed through the JS config envelope, but only the Swift bridge assigns it to the native SDK.
The requested Android plumbing should follow that established shape once posthog-android has a released, stable API and minimum version for the gesture-deferral/background-capture behavior. We should avoid adding a speculative RN option before that API is settled. At that point, the minimal work is to add the typed RN setting, include it in sdkReplayConfig, bump the Android dependency as required, map the bridge field onto the native config, and cover both the JS setup envelope and Android bridge mapping. Because this changes screenshot timing, it should also be validated with a real gesture/scroll replay test so deferred captures neither cause jank nor leave recordings stale or incomplete.
Investigation
PostHogSessionReplayConfig exposes screenshotModeBackgroundCapture, explicitly documents it as iOS-only, and already exposes an Android-specific verifyScreenshotMaskAlignment option.
packages/react-native/src/posthog-rn.ts destructures replay settings and sends sdkReplayConfig in the native setup envelope, so the JS-to-native configuration path already exists.
The Android bridge unconditionally assigns sessionReplayConfig.screenshot = true; it maps masking, throttle delay, sample rate, log capture, and verifyScreenshotMaskAlignment, but contains no gesture-deferral or background-capture mapping.
The RN plugin currently compiles against com.posthog:posthog-android:3.61.0. No inspected repository source identifies an Android gesture-deferral/background-capture property available in that dependency, so an exact bridge assignment cannot be safely specified yet.
Existing tests snapshot the full JS native setup envelope and Android has focused mapping tests for verifyScreenshotMaskAlignment; these are the appropriate regression-test locations for a future concrete option.
Reason: The RN bridge work will be localized once the upstream Android option, semantics, and minimum supported posthog-android version are known, but implementing it now would require inventing an API and behavior. Capture deferral also changes screenshot timing, so replay completeness must be tested rather than assumed.
Fix PR skipped: feature requests require an explicit trusted fix command or mode: fix before opening a draft PR
Please include memory pressure when prioritizing this work.
Our React Native app sees repeated Android OOMs on media-heavy screens while replay is enabled. Capture deferral should reduce unnecessary bitmap churn. Bitmap reuse or downscaling from PostHog/posthog-android#750 would also help.
If y'all accept external contributions let me know
we do! though PostHog/posthog-android#756 may be a viable solution here - we'll make sure it makes its way into React Native as well. i'll keep this issue open until then.
closing the loop on this - as of posthog-android v3.63.0+ and posthog-react-native v4.71.0+, the following experimental configuration options are available. i recommend trying them out for improved frame times and memory usage. currently android only.
sessionReplayConfig: {// ...// Experimental screenshot settings (Android only, requires @posthog/react-native-plugin).// We recommend these values to balance performance and image quality.// Lower resolution and RGB_565 reduce capture time and memory use.// Scale each screenshot dimension from 0.1 to 1.0. Default is 1.0.// A scale of 0.5 captures one quarter of the pixels, with less image detail.screenshotScale: 0.5,// RGB_565 uses two bytes per pixel instead of four, with lower color precision// and no transparency. Transparent window regions appear black. Default is ARGB_8888.screenshotColorMode: "RGB_565",// WebP compression quality from 0 to 100. Default is 30.// Lower quality reduces payload size at the cost of image detail.screenshotCompressionQuality: 30}
Activity
github-actions commentedon Sep 1, 2026
AI triage for #4734
Conclusion: Valid React Native Android session-replay enhancement, but it is blocked on a concrete posthog-android API for gesture-aware/background screenshot capture.
Confidence: 94%
Suggested labels:
react-native,Android,feature/replay,enhancement,team/client-librariesThanks — the RN-side limitation is confirmed. The Android bridge currently unconditionally sets
sessionReplayConfig.screenshot = true, so RN consumers cannot select wireframe mode. The existingscreenshotModeBackgroundCapturesetting is intentionally iOS-only: it is already passed through the JS config envelope, but only the Swift bridge assigns it to the native SDK.The requested Android plumbing should follow that established shape once posthog-android has a released, stable API and minimum version for the gesture-deferral/background-capture behavior. We should avoid adding a speculative RN option before that API is settled. At that point, the minimal work is to add the typed RN setting, include it in
sdkReplayConfig, bump the Android dependency as required, map the bridge field onto the native config, and cover both the JS setup envelope and Android bridge mapping. Because this changes screenshot timing, it should also be validated with a real gesture/scroll replay test so deferred captures neither cause jank nor leave recordings stale or incomplete.Investigation
PostHogSessionReplayConfigexposesscreenshotModeBackgroundCapture, explicitly documents it as iOS-only, and already exposes an Android-specificverifyScreenshotMaskAlignmentoption.packages/react-native/src/posthog-rn.tsdestructures replay settings and sendssdkReplayConfigin the native setup envelope, so the JS-to-native configuration path already exists.sessionReplayConfig.screenshot = true; it maps masking, throttle delay, sample rate, log capture, andverifyScreenshotMaskAlignment, but contains no gesture-deferral or background-capture mapping.sdkReplayConfig["screenshotModeBackgroundCapture"]and assigns it toconfig.sessionReplayConfig.screenshotModeBackgroundCapture, verifying the feat: add support for background capture for session replay #3552-style precedent.com.posthog:posthog-android:3.61.0. No inspected repository source identifies an Android gesture-deferral/background-capture property available in that dependency, so an exact bridge assignment cannot be safely specified yet.verifyScreenshotMaskAlignment; these are the appropriate regression-test locations for a future concrete option.Relevant files:
packages/react-native/src/types.ts,packages/react-native/src/posthog-rn.ts,packages/react-native-plugin/android/src/main/java/com/posthogreactnativeplugin/PosthogReactNativePluginModule.kt,packages/react-native-plugin/android/build.gradle,packages/react-native-plugin/ios/PosthogReactNativePlugin.swift,packages/react-native-plugin/android/src/test/java/com/posthogreactnativeplugin/PosthogReactNativePluginModuleTest.kt,packages/react-native/test/session-replay-request-headers.spec.ts,packages/react-native-plugin/CHANGELOG.mdFix assessment
Fix PR skipped: feature requests require an explicit trusted fix command or mode: fix before opening a draft PR
Pi session
The resumable JSONL pi session for this run was saved to a private gist: https://gist.github.com/marandaneto/679981a3ced6e9d3f71d11ac6eae61d0
Download it locally, then fork it into your own pi session:
Saved session:
call-1-1-2026-09-01T21-04-13-516Z_01a05ec9-6acc-7573-9aa0-ca53f9a0275d.jsonlClose proposal
None. No issue close action was taken.
Generated by posthog-watcher-action using pi.
LuisOsta commentedon Sep 1, 2026
If y'all accept external contributions let me know
4shutosh commentedon Sep 2, 2026
Please include memory pressure when prioritizing this work.
Our React Native app sees repeated Android OOMs on media-heavy screens while replay is enabled. Capture deferral should reduce unnecessary bitmap churn. Bitmap reuse or downscaling from PostHog/posthog-android#750 would also help.
dustinbyrne commentedon Sep 7, 2026
we do! though PostHog/posthog-android#756 may be a viable solution here - we'll make sure it makes its way into React Native as well. i'll keep this issue open until then.
dustinbyrne commentedon Sep 22, 2026
closing the loop on this - as of
posthog-androidv3.63.0+ andposthog-react-nativev4.71.0+, the following experimental configuration options are available. i recommend trying them out for improved frame times and memory usage. currently android only.via https://posthog.com/docs/session-replay/installation/react-native#configure-posthog-with-session-replay
closing this issue for now, but feel free to re-open or open a new issue if issues persist! thanks all! 🙌