feat: session replay minimum recording duration#482
Conversation
|
This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the |
|
This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the |
# Conflicts: # posthog-android/api/posthog-android.api # posthog-android/src/main/java/com/posthog/android/replay/PostHogReplayIntegration.kt # posthog/src/main/java/com/posthog/internal/PostHogRemoteConfig.kt
posthog-android Compliance ReportDate: 2026-04-29 20:29:50 UTC
|
| Test | Status | Duration |
|---|---|---|
| Request Payload.Request With Person Properties Device Id | ❌ | 272ms |
Failures
request_payload.request_with_person_properties_device_id
404, message='Not Found', url='http://sdk-adapter:8080/get_feature_flag'
dustinbyrne
left a comment
There was a problem hiding this comment.
Got through some of this but I have to step away. I'll circle back when I can if nobody else gets to it first!
| * [PostHogReplayBufferDelegate]. When [PostHogReplayBufferDelegate.isBuffering] | ||
| * is true, snapshots are routed to the buffer and `flush()` calls are suppressed. | ||
| */ | ||
| public class PostHogReplayQueue internal constructor( |
There was a problem hiding this comment.
Can this be internal? Does it need to be public?
| if (bufferDelegate?.isBuffering == true) { | ||
| bufferQueue.add(event) | ||
| config.logger.log("Buffered replay event '${event.event}'. Buffer depth: ${bufferQueue.depth}") | ||
| bufferDelegate?.onReplayBufferSnapshot(this) | ||
| } else { | ||
| innerQueue.add(event) | ||
| } |
There was a problem hiding this comment.
This is a synchronous write to disk. Perhaps this queue should be constructed with an ExecutorService similar to PostHogQueue and serialize buffer writes through it to avoid blocking the calling thread?
| // Reset minimum duration buffering state for the new session | ||
| resetBufferingState() |
There was a problem hiding this comment.
start is only called once globally afaik, so it seems like this call would be better off in onSessionIdChanged?
💡 Motivation and Context
Adds support for the minimumDurationMilliseconds remote config setting for session replay and follows the implementation as described in PostHog/posthog-ios#548
💚 How did you test it?
📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset file