René's URL Explorer Experiment


Title: Session Replay segment, buffer and gesture timestamps read the wall clock · Issue #6522 · getsentry/sentry-java · GitHub

Open Graph Title: Session Replay segment, buffer and gesture timestamps read the wall clock · Issue #6522 · getsentry/sentry-java

X Title: Session Replay segment, buffer and gesture timestamps read the wall clock · Issue #6522 · getsentry/sentry-java

Description: Follow-up to #5578. #6090 moved the 1h session cap and the 50ms move debounce onto the monotonic clock. Everything else #5578 listed still reads the wall clock. What still reads the wall clock Segment boundary. SessionCaptureStrategy cut...

Open Graph Description: Follow-up to #5578. #6090 moved the 1h session cap and the 50ms move debounce onto the monotonic clock. Everything else #5578 listed still reads the wall clock. What still reads the wall clock Segm...

X Description: Follow-up to #5578. #6090 moved the 1h session cap and the 50ms move debounce onto the monotonic clock. Everything else #5578 listed still reads the wall clock. What still reads the wall clock Segm...

Opengraph URL: https://github.com/getsentry/sentry-java/issues/6522

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Session Replay segment, buffer and gesture timestamps read the wall clock","articleBody":"Follow-up to getsentry/sentry-java#5578. getsentry/sentry-java#6090 moved the 1h session cap and the 50ms move debounce onto the monotonic clock. Everything else getsentry/sentry-java#5578 listed still reads the wall clock.\n\n## What still reads the wall clock\n\n* **Segment boundary.** `SessionCaptureStrategy` cuts a segment when `frameTimestamp - segmentTimestamp` reaches 5s.\n* **Buffer trim.** `BufferCaptureStrategy` keeps the last 30s with `now - errorReplayDuration`. It computes the buffered segment's duration as `now - firstFrame`.\n* **Frame windows.** `ReplayCache.createVideoOf` and `rotate` walk epoch-millis windows. Frame files are named by epoch millis.\n* **Gesture timestamps.** `ReplayGestureConverter` stamps touch start, end, cancel and move events with the wall clock. The gesture batch timer and `timeOffset` durations are split out to getsentry/sentry-java#6523, which lands before v9.\n\n## What goes wrong\n\nA backward step mid-recording makes new frames look older than the segment they belong to. They fall outside the window, and `rotate` deletes them until the wall clock catches back up. Breadcrumbs from that stretch are dropped the same way. A forward step cuts a 5s segment of one frozen frame on every captured frame until the segment start catches up, so a 2-minute step sends about 24 frozen segments in 30s. Buffer mode fails too: a backward step makes the buffered duration negative, and a forward step rotates out the whole buffer.\n\n## Not a breaking change\n\nLands on main (decided on 2026-11-10), as a one-off exception to the project's rule that timestamps wait for v9. Today's behavior is a live bug, and the timestamps sent only change after a clock jump.\n\nChecked on `main` on 2026-11-09:\n\n* **Session counts.** Replay doesn't start, end or time release-health sessions. `LifecycleWatcher` decides, and replay follows. Crash-free rate and replay counts can't move.\n* **Public API.** Every public replay method that carries time takes epoch millis as a `Long`. An `AnchoredClock` still produces epoch millis. The `ICurrentDateProvider` constructor parameter must stay, because sentry-dart calls the four-argument `ReplayIntegration` constructor.\n* **Metrics.** On Android the ticker counts deep sleep, like the wall clock. With no clock step the output is the same. After a step it gets more accurate.\n\n## Decision: one anchor per recording that re-anchors on a clock jump\n\nDecided on 2026-11-10.\n\n* Anchor an `AnchoredClock` at `start()`, which reads the wall clock today, so no value changes there. Only a captured frame re-anchors: `resume()` reuses the current anchor, and the first frame after resume follows a jump made while paused, like any other jump. Re-anchoring at `resume()` would make every request queued behind it look like it raced a jump.\n* On every captured frame, compare a fresh wall-clock reading with the anchored time. If they differ by more than 1s, close the current segment at the old timeline's \"now\" and start the next segment on a new anchor.\n* With no jump, every value sent is the same as today, apart from rounding of up to 1ms.\n* After a jump, no frames are lost, and breadcrumbs, errors and spans stay aligned with the video to within one frame. The jump shows up once: a gap after a forward jump, an overlap after a backward one.\n\nRejected:\n\n* **One anchor, never re-anchored:** breadcrumbs, errors and spans stay offset for up to an hour.\n* **New anchor at each segment boundary:** changes values even without a jump, and the player freezes briefly every 5s.\n* **Project only breadcrumbs onto the replay clock:** errors and spans stay offset.\n* **End the replay on a jump:** splits one session into two replays.\n\nAlso decided:\n\n* After a backward jump the next segment overlaps the previous one, and the player's video lags its timeline until the user seeks. Accepted; the player fix is a separate frontend request.\n* A forward jump longer than the 1h session cap stops a session recording, as hitting the cap does. In buffer mode it drops the buffered video from before the jump and keeps recording, so a replay never spans a gap of hours or years.\n* Requests already queued when the clock re-anchors (pause, flush, configuration change, error) recompute from the new timeline, so no segment mixes two timelines.\n* The jump tolerance is 1s, just under the player's 1.1s \"Video Unavailable\" marker.\n* The jump detector stays internal to `sentry-android-replay`.\n* `ReplayIntegration`'s `ICurrentDateProvider` stays and becomes the anchor's wall clock, so no constructor changes.\n* After a jump in buffer mode, crash recovery only gets the frames from after the jump.\n\n## Done when\n\n* The four sites above take time from the re-anchoring replay clock. `ReplayGestureConverter` gets it through the `ICurrentDateProvider` it already takes, so this change doesn't touch that file and doesn't depend on getsentry/sentry-java#6523.\n* Frames on disk stay in epoch millis, so crash recovery on the next launch still works.\n* Tests cover a backward and a forward step for segments, the buffer trim and gesture timestamps, and a forward jump over 1h stops the recording.\n* The `ICurrentDateProvider` parameters stay; removing them is getsentry/sentry-java#6506.\n\n\u003cdetails>\u003csummary>Agent notes\u003c/summary>\n\nVerified on `main` at `5652060246` (2026-11-09).\n\n* Segment boundary: `SessionCaptureStrategy.kt:144`. Frame stamp: `:117`.\n* Buffer: `BufferCaptureStrategy.kt:138` (frame stamp), `:143` (rotate on frame), `:199` (`onTouchEvent` → `rotateEvents`), `:263-269` (segment start and duration).\n* `ReplayCache.kt`: `:81` (file name), `:179-189` (`createVideoOf` window loop), `:220` (`rotate(until = from + duration)`), `:260` (`rotate`), `:442` (`fromDisk` parses the filename into the timestamp).\n* `ReplayGestureConverter.kt`: `:74` (move event `timestamp`), `:105`, `:128`, `:142` (touch start, end and cancel timestamps). The batch timer and `timeOffset` (`:39`, `:63`, `:67-68`) are getsentry/sentry-java#6523.\n* Breadcrumb window filter: `CaptureStrategy.kt:209-212`. Gesture event filter: `:235-236`. `Breadcrumb()` stamps `System.currentTimeMillis()` (`Breadcrumb.java:567`). `maxBreadcrumbs` defaults to 100.\n* `TODO [v9]` markers: `BaseCaptureStrategy.kt:59`, `ReplayGestureConverter.kt:16`.\n* `AnchoredClock` (`sentry/src/main/java/io/sentry/time/AnchoredClock.java`) has `create(EpochClock, MonotonicTicker)`, `startTime()`, `now()`. No drift check.\n* Clocks: `options.monotonicTicker` (Android: `elapsedRealtimeNanos`) is already passed to both strategies (`ReplayIntegration.kt:236-247`). Epoch source: `options.epochClock`.\n* Public timestamp APIs in `sentry-android-replay.api`: `ReplayCache.addFrame(File, long, String)`, `ReplayCache.createVideoOf(long, long, …)`, `GeneratedVideo(File, int, long)`, `ReplayIntegration.onScreenshotRecorded(File, long)`.\n* Hybrid callers: sentry-dart `SentryFlutterPlugin.kt` (around line 293) calls `ReplayIntegration(ctx, dateProvider = CurrentDateProvider.getInstance(), recorderProvider, replayCacheProvider = null)`. `android_replay_recorder.dart` calls `onScreenshotRecorded(bitmap)`, with no timestamp. sentry-react-native's Android code only imports `DefaultReplayBreadcrumbConverter`. Unity and KMP were not checked (GitHub code search rate limit).\n* Gotchas from #6090: evaluate time checks when the frame is captured, not in the queued `replayExecutor` task (`SessionCaptureStrategyTest`: \"executor delay does not trigger a segment boundary\"). Gesture tests that step the clock by more than \\~500ms hit `CAPTURE_MOVE_EVENT_THRESHOLD` instead of the debounce.\n* Code plan (2026-11-10): new internal `capture/ReplayClock.kt` holding a volatile `AnchoredClock` and a generation counter, with `restart()`, `nowMillis()` and `checkForStep(): Rebase(oldNowMs, newStartMs)?`. Session strategy checks at capture (`:117`) and, on a rebase, closes `[segmentTimestamp, oldNow)` before storing the frame. Buffer strategy computes the trim cutoff at capture and ages buffered segments on a `Stopwatch`. The gesture converter gets `ICurrentDateProvider { replayClock.nowMillis() }` at `BaseCaptureStrategy.kt:72`.\n\n\u003c/details>","author":{"url":"https://github.com/runningcode","@type":"Person","name":"runningcode"},"datePublished":"2026-11-09T15:55:36Z","url":"https://github.com/getsentry/sentry-java/issues/6522"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:899c3c73-fb61-f6f2-148b-26a0055e17f8
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB0D2:2366B8:4F177A:69F40C:6B04A362
html-safe-nonce8e96013f47c6ed15134ea6b3b1cef3f42f1e25de1aff36e435beb9d55d622d02
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMEQyOjIzNjZCODo0RjE3N0E6NjlGNDBDOjZCMDRBMzYyIiwidmlzaXRvcl9pZCI6Ijc5NzUyMjkwNTE4MDE3NDAxMzAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac37f9356283a2bc4267e105563dfe31baf74e1136a751fa31a5eeb809339b2320
hovercard-subject-tagissue:6289555872
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-java/6522/issue_layout
twitter:imagehttps://opengraph.githubassets.com/0032d238eb34cbe17339d0b101c909a907ddb72418104f935a3e42b43bccd56a/getsentry/sentry-java/issues/6522
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/0032d238eb34cbe17339d0b101c909a907ddb72418104f935a3e42b43bccd56a/getsentry/sentry-java/issues/6522
og:image:altFollow-up to #5578. #6090 moved the 1h session cap and the 50ms move debounce onto the monotonic clock. Everything else #5578 listed still reads the wall clock. What still reads the wall clock Segm...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamerunningcode
hostnamegithub.com
expected-hostnamegithub.com
None9784b6f42e2d5eac4e394fa88cad134c0dc5b6662b4ff2787a1ed1ef5a96331d
turbo-cache-controlno-preview
go-importgithub.com/getsentry/sentry-java git https://github.com/getsentry/sentry-java.git
octolytics-dimension-user_id1396951
octolytics-dimension-user_logingetsentry
octolytics-dimension-repository_id3368190
octolytics-dimension-repository_nwogetsentry/sentry-java
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id3368190
octolytics-dimension-repository_network_root_nwogetsentry/sentry-java
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release3fd14143b75b2af7b76bbd23b069867d091adfcc
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/getsentry/sentry-java/issues/6522#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-java%2Fissues%2F6522
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-java%2Fissues%2F6522
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=getsentry%2Fsentry-java
Reloadhttps://github.com/getsentry/sentry-java/issues/6522
Reloadhttps://github.com/getsentry/sentry-java/issues/6522
Reloadhttps://github.com/getsentry/sentry-java/issues/6522
getsentryhttps://github.com/getsentry
sentry-javahttps://github.com/getsentry/sentry-java
Codehttps://github.com/getsentry/sentry-java
Issues266 (266)https://github.com/getsentry/sentry-java/issues
Pull requests57 (57)https://github.com/getsentry/sentry-java/pulls
Discussionshttps://github.com/getsentry/sentry-java/discussions
Actionshttps://github.com/getsentry/sentry-java/actions
Projectshttps://github.com/getsentry/sentry-java/projects
Security and quality2 (2)https://github.com/getsentry/sentry-java/security
Insightshttps://github.com/getsentry/sentry-java/insights
https://github.com/getsentry/sentry-java
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-java/issues/6522
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-java/issues/6522
#6542https://github.com/getsentry/sentry-java/pull/6542
Session Replay segment, buffer and gesture timestamps read the wall clockhttps://github.com/getsentry/sentry-java/issues/6522#top
#6542https://github.com/getsentry/sentry-java/pull/6542
https://github.com/runningcode
Platform: Javahttps://github.com/getsentry/sentry-java/issues?q=state%3Aopen%20label%3A%22Platform%3A%20Java%22
https://github.com/runningcode
runningcodehttps://github.com/runningcode
on Nov 9, 2026https://github.com/getsentry/sentry-java/issues/6522#issue-6289555872
#5578https://github.com/getsentry/sentry-java/issues/5578
#6090https://github.com/getsentry/sentry-java/pull/6090
#5578https://github.com/getsentry/sentry-java/issues/5578
Session Replay gesture batching measures durations with the wall clock #6523https://github.com/getsentry/sentry-java/issues/6523
Session Replay gesture batching measures durations with the wall clock #6523https://github.com/getsentry/sentry-java/issues/6523
Breaking clock changes for v9: span timing and ICurrentDateProvider removal #6506https://github.com/getsentry/sentry-java/issues/6506
Session Replay gesture batching measures durations with the wall clock #6523https://github.com/getsentry/sentry-java/issues/6523
fix(replay): Measure recording deadlines on a monotonic clock (JAVA-575) #6090https://github.com/getsentry/sentry-java/pull/6090
runningcodehttps://github.com/runningcode
on Nov 9, 2026https://github.com/getsentry/sentry-java/issues/6522#event-35586723321
https://github.com/apps/linear-code
linear-codehttps://github.com/apps/linear-code
on Nov 9, 2026https://github.com/getsentry/sentry-java/issues/6522#issuecomment-6744570537
Linear Codehttps://linear.app
JAVA-829https://linear.app/getsentry/issue/JAVA-829
runningcodehttps://github.com/runningcode
Platform: Javahttps://github.com/getsentry/sentry-java/issues?q=state%3Aopen%20label%3A%22Platform%3A%20Java%22
Next Majorhttps://github.com/getsentry/sentry-java/issues?q=state%3Aopen%20label%3A%22Next%20Major%22
on Nov 9, 2026https://github.com/getsentry/sentry-java/issues/6522#event-35586726073
runningcodehttps://github.com/runningcode
on Nov 9, 2026https://github.com/getsentry/sentry-java/issues/6522#event-35588686209
runningcodehttps://github.com/runningcode
Next Majorhttps://github.com/getsentry/sentry-java/issues?q=state%3Aopen%20label%3A%22Next%20Major%22
on Nov 10, 2026https://github.com/getsentry/sentry-java/issues/6522#event-35688946972
runningcodehttps://github.com/runningcode
on Nov 10, 2026https://github.com/getsentry/sentry-java/issues/6522#event-35695411645
fix(replay): Drop the buffer at too-long jumps and re-read raced segm…https://github.com/getsentry/sentry-java/commit/64e0dc0b879379cb7c582c5aade3eb5a528271fe
64e0dc0https://github.com/getsentry/sentry-java/commit/64e0dc0b879379cb7c582c5aade3eb5a528271fe
fix(replay): Keep the replay timeline anchored across wall-clock jumpshttps://github.com/getsentry/sentry-java/commit/9bc0f741619c9cff1bc0a8465ec3cc1e3761a466
9bc0f74https://github.com/getsentry/sentry-java/commit/9bc0f741619c9cff1bc0a8465ec3cc1e3761a466
fix(replay): Drop the buffer at too-long jumps and re-read raced segm…https://github.com/getsentry/sentry-java/commit/e795ee0fa16bff5e3d71e44703cd76726e9d7592
e795ee0https://github.com/getsentry/sentry-java/commit/e795ee0fa16bff5e3d71e44703cd76726e9d7592
fix(replay): Keep the replay timeline anchored across wall-clock jumpshttps://github.com/getsentry/sentry-java/commit/611cf034cbb772f1bff42e973c71d62b8b9c386b
611cf03https://github.com/getsentry/sentry-java/commit/611cf034cbb772f1bff42e973c71d62b8b9c386b
fix(replay): Drop the buffer at too-long jumps and re-read raced segm…https://github.com/getsentry/sentry-java/commit/b9aa06feb9207f60150f8ce992fb6c53297ca6f5
b9aa06fhttps://github.com/getsentry/sentry-java/commit/b9aa06feb9207f60150f8ce992fb6c53297ca6f5
Sign up for freehttps://github.com/signup?return_to=https://github.com/getsentry/sentry-java/issues/6522
Sign in to commenthttps://github.com/login?return_to=https://github.com/getsentry/sentry-java/issues/6522
runningcodehttps://github.com/runningcode
Platform: Javahttps://github.com/getsentry/sentry-java/issues?q=state%3Aopen%20label%3A%22Platform%3A%20Java%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.