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
{{ message }}
Repository navigation
Respect session replay feature flag after /config endpoint call #441
Session recordings start as soon as the app launches, but feature flag evaluation is executed asynchronously.
If the cached value is different that the value returned from /decide endpoint, then the recording may start (and not stop) when the flag evaluates to false
A possible fix is to mem-cache screenshots and skip processing until the /decide API has been successfully called - there are some memory footprint consideration here. We may need to use a different disk-backed queue, and drop or merge the queues once the flag evaluates?
Dart does start the screenshot loop when PostHogConfig.sessionReplay is true. ScreenshotCapturer.captureScreenshot() still returns without sending when getSessionReplayState() reports isActive == false. While the cached flag is on, isActive stays true and frames are handed to native, which is the buffered path. After /config turns replay off, the next tick stops sending.
The sdk-spec for remote config also treats Flutter as a wrapper: it forwards sessionReplay to the native SDKs and does not own the /config fetch. Happy to revisit if $snapshot from this plugin is supposed to bypass that queue.
Activity
o-mid commentedon Sep 28, 2026
Looked at this on current
main. I don't think a Dart change is the right fix.Flutter does not upload replay itself.
sendMetaEvent/sendFullSnapshotbecome$snapshotcaptures, and both native SDKs put those on the replay queue:SnapshotSendercallsList<RREvent>.capture(), which isPostHog.captureand thenreplayQueue.addPosthogFlutterPlugincallsPostHogSDK.shared.capture("$snapshot", ...), which also goes toreplayQueueThat queue is what holds snapshots until the first live
/configand drops them if replay is off:posthog_flutter.podspecandPackage.swiftrequire>= 3.84.0android/build.gradlerequires[3.71.0,4.0.0)Dart does start the screenshot loop when
PostHogConfig.sessionReplayis true.ScreenshotCapturer.captureScreenshot()still returns without sending whengetSessionReplayState()reportsisActive == false. While the cached flag is on,isActivestays true and frames are handed to native, which is the buffered path. After/configturns replay off, the next tick stops sending.Same conclusion as on the React Native issue: PostHog/posthog-js#3859 (comment)
The sdk-spec for remote config also treats Flutter as a wrapper: it forwards
sessionReplayto the native SDKs and does not own the/configfetch. Happy to revisit if$snapshotfrom this plugin is supposed to bypass that queue.