Repository navigation
Conversation
A segment's video duration is rounded up to whole frames, so its end can be up to one frame interval after the time the segment was cut (flush, configuration change, buffer conversion). The next segment took breadcrumbs and touch events only from that rounded end, so events in between were dropped, e.g. touches right after an error converted a buffered replay. Give segments an event window separate from the video window: a cut segment takes events up to the cut time, and the next segment takes them from there. Video timestamps do not change, so playback stays aligned; the player places events by their own timestamps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
📲 Install BuildsAndroid
|
Contributor
Author
|
Closing: the loss is limited to touch events within one frame interval after a segment cut (breadcrumbs usually still land in the cut segment because encoding is slower than the gap), which we decided is acceptable for now. The analysis and the emulator results in the description stay here for reference. |
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.
📜 Description
Touch events and breadcrumbs that happen right after a segment is cut are no longer dropped.
A segment's video duration is rounded up to whole frames, so its end (
start + video duration) can be up to one frame interval (1 s at 1 fps) after the time the segment was actually cut. That happens when a segment is cut at an arbitrary time: buffer → session conversion (error capture orflush()in buffer mode),flush()in session mode, and configuration changes. The next segment started at that rounded end for its video and its events, so events between the real cut and the rounded end were in neither segment. On devices this mostly hits touch events after a buffered replay is converted: they go to the session strategy, whose first segment only took events from the rounded end.Segments now have an event window separate from the video window:
requestedAtin session mode,nowin buffer mode) instead of its rounded video end;eventsStartTimestamp), so event windows are back to back with no gap and no overlap;Why not shift the video instead: the replay player (
videoReplayer.tsx) runs a timer and chains videos onended. It waits on gaps but does not resync on overlaps, so starting the next video at the cut time would leave the video up to 1 s behind the timeline. Events are merged across segments and placed by their own timestamps (replayReader.tsx), so an event slightly before its segment's video start is shown at the right time.The detekt baseline changes only re-key existing entries for
createSegment,buildReplayandcreateSegmentInternal, whose signatures gained the two optional parameters.💡 Motivation and Context
Found while verifying #6340: frames and events between a flush and the rounded end of the flushed segment did not show up in the replay.
💚 How did you test it?
New tests in
SessionCaptureStrategyTestandBufferCaptureStrategyTestcover a breadcrumb after a flush landing in the next segment exactly once, and a buffered segment leaving breadcrumbs after its cut to the next segment. Two of them fail without the fix (the third pins the new placement).On an API 34 emulator with the sample app and a local mock ingest server:
startBuffering(),flush()after 5 s, then a navigation breadcrumb and a tap 150 ms after the flush, a control tap 2.5 s after the flush, andstop()after 6 s.mainVideo sizes were identical between
mainand this PR.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
🤖 Generated with Claude Code