Skip to content

fix(replay): Anchor network span timestamps to the breadcrumb clock - #6959

Merged
alwx merged 3 commits into
mainfrom
alwx/bugfix/replay-network-span-timestamps
Oct 29, 2026
Merged

alwx merged 3 commits into
mainfrom
alwx/bugfix/replay-network-span-timestamps

Conversation

@alwx

@alwx alwx commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Replay network span start_timestamp/end_timestamp are now anchored to breadcrumb.timestamp (Date.now() clock). Only the request duration is taken from the xhr hint, whose timestamps come from the performance clock.

💡 Motivation and Context

The native SDKs select breadcrumbs for a segment by breadcrumb.timestamp but emit the rrweb span with the data timestamps. When the two clocks drift (device sleep, NTP correction), the network span lands minutes away from the video and the other breadcrumbs. The product computes the replay start as the minimum of all timestamps, so the timeline is stretched backwards with an empty gap and misplaced touch markers. Fixes getsentry/team-replay#548.

💚 How did you test it?

Unit tests in test/replay/xhrUtils.test.ts, including a case with a 12-minute clock drift.

📝 Checklist

  • I added tests to verify changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • All tests passing.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.
  • No breaking changes.

alwx added 2 commits October 28, 2026 12:00
The replay network span `start_timestamp`/`end_timestamp` were copied from
the xhr hint, which `@sentry/core` fills with `timestampInSeconds()`
(performance clock). The breadcrumb itself is stamped with `Date.now()`.
The native SDKs select breadcrumbs for a segment by `breadcrumb.timestamp`
but emit the rrweb span with the data timestamps, so once the two clocks
drift (device sleep, NTP correction) the network span lands minutes away
from the video and every other breadcrumb. The product computes the replay
start as the minimum of all timestamps, so the timeline was stretched
backwards with an empty gap and misplaced touch markers
(getsentry/team-replay#548).

Keep only the request duration from the hint and anchor it to
`breadcrumb.timestamp`, so the span shares the clock the native filter,
the video and the other breadcrumbs already use.
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

⚪ None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


  • fix(replay): Anchor network span timestamps to the breadcrumb clock by alwx in #6959
  • chore(deps): update React Native to v0.88.1 by antonis and claude with github-actions in #6962
  • chore(deps): update Cocoa SDK to v9.32.0 by github-actions in #6963
  • test(e2e): Widen WebView demo-page trace poll window to de-flake e2e by antonis and claude in #6950
  • chore(deps): bump qs from 6.16.0 to 6.17.0 by antonis and claude with dependabot in #6960
  • chore(deps): update JavaScript SDK to v10.77.1 by antonis and claude in #6952
  • fix(ios): Don't crash on a null DSN in sentry.options.json by antonis and claude in #6958
  • build(deps): Pin follow-redirects to patched 1.16.1+ to resolve credential-leak advisories by antonis and claude in #6949
  • fix(ios): Start native SDK without options file by trollixx in #6956
  • build(node): Bump Node to 22.23.4 by geoffg-sentry with sentry-junior in #6954
  • fix(tracing): Support Expo Router 58 in expoRouterIntegration by alwx in #6923
  • fix(android): Persist hard-crash envelopes to disk before the process exits by alwx in #6937
  • feat(tracing): Track WebView trace-propagation feature adoption by antonis and claude in #6938
  • build(deps): Bump body-parser to 2.4.0 to resolve DoS advisory by antonis and claude in #6948
  • fix(android): Apply screenshot masking options to error and feedback screenshots by antonis and claude in #6930
  • chore(deps): update Android SDK to v8.62.0 by github-actions in #6932
  • chore(deps): update Maestro to v2.12.0 by github-actions in #6945
  • chore(deps): bump getsentry/craft/.github/workflows/changelog-preview.yml from 2.35.0 to 3.0.0 by dependabot in #6944
  • chore(deps): bump the codeql-action group with 3 updates by dependabot in #6940
  • chore(deps): bump actions/upload-artifact from 7.0.1 to 7.0.2 by dependabot in #6941
  • chore(deps): bump fast-uri from 3.1.8 to 3.1.9 by antonis and claude with dependabot in #6946
  • chore(deps): bump undici from 6.29.0 to 6.29.1 by dependabot in #6947
  • chore(deps): bump actions/setup-node from 7.0.0 to 7.1.0 by dependabot in #6943
  • chore(deps): bump ruby/setup-ruby from 1.327.0 to 1.334.0 by dependabot in #6942

Plus 4 more


🤖 This preview updates automatically when you update the PR.

@alwx
alwx marked this pull request as ready for review October 28, 2026 11:38
@alwx
alwx requested review from a team and lucas-zimerman as code owners October 28, 2026 11:38
@antonis antonis added the ready-to-merge Triggers the full CI test suite label Oct 28, 2026
@sentry

sentry Bot commented Oct 28, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
Sentry RN io.sentry.reactnative.sample 8.32.0 (112) Release

⚙️ sentry-react-native Build Distribution Settings

@antonis antonis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alwx
alwx enabled auto-merge (squash) October 29, 2026 09:33
@alwx
alwx merged commit 10a171b into main Oct 29, 2026
40 of 76 checks passed
@alwx
alwx deleted the alwx/bugfix/replay-network-span-timestamps branch October 29, 2026 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Triggers the full CI test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants