Title: Session Replay gesture batching measures durations with the wall clock · Issue #6523 · getsentry/sentry-java · GitHub
Open Graph Title: Session Replay gesture batching measures durations with the wall clock · Issue #6523 · getsentry/sentry-java
X Title: Session Replay gesture batching measures durations with the wall clock · Issue #6523 · getsentry/sentry-java
Description: Split from #6522. These two pieces measure how long something took, so they can move to a Stopwatch before v9. Check-in durations did the same in #6032. The gesture timestamps (when something happened) stay on the wall clock and are part...
Open Graph Description: Split from #6522. These two pieces measure how long something took, so they can move to a Stopwatch before v9. Check-in durations did the same in #6032. The gesture timestamps (when something happe...
X Description: Split from #6522. These two pieces measure how long something took, so they can move to a Stopwatch before v9. Check-in durations did the same in #6032. The gesture timestamps (when something happe...
Opengraph URL: https://github.com/getsentry/sentry-java/issues/6523
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Session Replay gesture batching measures durations with the wall clock","articleBody":"Split from getsentry/sentry-java#6522. These two pieces measure how long something took, so they can move to a `Stopwatch` before v9. Check-in durations did the same in getsentry/sentry-java#6032. The gesture timestamps (when something happened) stay on the wall clock and are part of getsentry/sentry-java#6522, which waits for v9.\n\n## What reads the wall clock\n\nWhile a finger moves, `ReplayGestureConverter` batches touch positions and sends them as one move event every 500ms. Two things there subtract one wall-clock reading from another:\n\n* **Batch timer.** The batch is sent once `now - touchMoveBaseline` passes 500ms. This only decides when to send, so nothing in the payload changes. It's the sibling of the 50ms move debounce that getsentry/sentry-java#6090 moved to a `Deadline`.\n* `timeOffset`**.** Each position records how long after the batch started it happened, always under about 500ms. It is sent to Sentry, but it's a duration, not a timestamp.\n\n## What goes wrong\n\nIf the clock steps backward during a swipe, `now - touchMoveBaseline` goes negative. The batch isn't sent until the clock catches back up, and if the finger lifts first, the batched positions are dropped. A forward step sends the batch at once, with offsets stretched by the size of the step.\n\n## Not a breaking change\n\nWith no clock step, the values are the same as today. It doesn't touch session counts, the public API or a critical customer metric.\n\n## Done when\n\n* The batch timer and `timeOffset` come from one `Stopwatch`, started when a batch begins, on the `ticker` the converter already takes.\n* Event timestamps (touch start, end and cancel, and the move event's `timestamp`) still use `dateProvider`. Those move in getsentry/sentry-java#6522.\n* Tests cover a backward and a forward clock step during a swipe.\n\n\u003cdetails>\u003csummary>Agent notes\u003c/summary>\n\nVerified on `main` at `5652060246` (2026-11-09).\n\n* `ReplayGestureConverter.kt`: `:39` (`now`), `:54-55` (baseline set, `0L` sentinel), `:63` (`timeOffset`), `:67-68` (batch check against `CAPTURE_MOVE_EVENT_THRESHOLD` = 500), `:76` (`pos.timeOffset -= totalOffset`), `:84` (baseline reset). A nullable `Stopwatch` can replace the `0L` sentinel.\n* Leave alone (getsentry/sentry-java#6522): `:74` (move event `timestamp`), `:105`, `:128`, `:142` (touch timestamps).\n* The `ticker` constructor parameter came in with #6090 and drives the 50ms debounce at `:43`.\n* Keep the `TODO [v9]` at `:16`. `dateProvider` is still needed for the event timestamps.\n* `Stopwatch` (`sentry/src/main/java/io/sentry/time/Stopwatch.java`): `started(MonotonicTicker)`, `elapsed(TimeUnit)`, `elapsedNanos()`.\n* Test gotcha from #6090: in gesture tests, a clock step over \\~500ms crosses `CAPTURE_MOVE_EVENT_THRESHOLD`. Keep steps small when testing the debounce.\n* Precedent for serialized durations on a monotonic clock: check-ins, #5611 (`System.nanoTime()`) then #6032 (`Stopwatch`).\n\n\u003c/details>","author":{"url":"https://github.com/runningcode","@type":"Person","name":"runningcode"},"datePublished":"2026-11-09T16:15:37Z","url":"https://github.com/getsentry/sentry-java/issues/6523"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f70b1f39-152e-adb3-f59a-3c41a577ff52 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E3FA:2953C9:1105A0E:17D057B:6B044ED9 |
| html-safe-nonce | 71e3ccacf48cdfa63f0eef034d1def663a9122b9cf682e3203df26f991f6e2f3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFM0ZBOjI5NTNDOToxMTA1QTBFOjE3RDA1N0I6NkIwNDRFRDkiLCJ2aXNpdG9yX2lkIjoiNTM2MTg2NzEwMTQ1Mzk2Mjk2OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 2480700e96439ab72edf40f9f8dd3aa55003f8ef37f7f60f156ff1e00330ee07 |
| hovercard-subject-tag | issue:6289905638 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-java/6523/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fdbded97f17144d816210bb9dcb42995e478c18ef0d7a1fbed33be2f4df67d33/getsentry/sentry-java/issues/6523 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fdbded97f17144d816210bb9dcb42995e478c18ef0d7a1fbed33be2f4df67d33/getsentry/sentry-java/issues/6523 |
| og:image:alt | Split from #6522. These two pieces measure how long something took, so they can move to a Stopwatch before v9. Check-in durations did the same in #6032. The gesture timestamps (when something happe... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | runningcode |
| hostname | github.com |
| expected-hostname | github.com |
| None | 002aa6b95ffa730b0aec436a5c383f536ad677284e60056037fb120afe37b730 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-java git https://github.com/getsentry/sentry-java.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3368190 |
| octolytics-dimension-repository_nwo | getsentry/sentry-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3368190 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 059f24c781e3a0d7df3f27a97da0e93fab06ae39 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width