fix(replay): split uploads at session and identity boundaries - #836
Open
dustinbyrne wants to merge 1 commit into
Open
dustinbyrne wants to merge 1 commit into
dustinbyrne wants to merge 1 commit into
Conversation
Contributor
|
[Medium risk] Changes how session replay batches are split and sent. The PR appears safe to merge; no actionable issues were found. Reviews (1) · Last reviewed commit: "fix(replay): split uploads at session an..." |
Contributor
posthog-android Compliance ReportDate: 2026-10-03 02:12:49 UTC ✅ All Tests Passed!46/46 tests passed Capture Tests✅ 29/29 tests passed View Details
Feature_Flags Tests✅ 17/17 tests passed View Details
|
dustinbyrne
marked this pull request as ready for review
October 3, 2026 16:16
turnipdabeets
approved these changes
Oct 3, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💡 Motivation and Context
Replay ingestion attributes an entire
/s/request to its first snapshot's session and distinct ID. Android's persisted replay queue could batch snapshots across those boundaries, filing a new session's opening frames under the preceding session after an app restart.This ports the batching fix released in posthog-ios 3.88.2:
This preserves the existing event-batcher specification and implements the replay-attribution contract proposed in sdk-specs #92, which is still open. Patch changesets cover
posthogandposthog-android.💚 How did you test it?
Local validation with JDK 17:
make testJava: all 1,022 core tests passed.make checkFormat: passed../gradlew :posthog:apiCheck :posthog-android:apiCheck :posthog-android:compileReleaseKotlin: passed.Validation is at the queue/HTTP layer. Android device kill/relaunch and Cloud ingestion/playback have not been tested.
📝 Checklist
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Pi implemented the Android port, with a fresh read-only
revieweragent checking the diff, callers, retry/lifecycle behavior, and tests. Tools used:read,edit,write,bash, andsubagent. The implementation keeps replay attribution policy in the existing endpoint specification and reuses the shared durable queue and retry handling.