Skip to content

fix(replay): Disable mousemove sampling in rrweb for iOS browsers #14937

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 8, 2025

Conversation

chargome
Copy link
Member

@chargome chargome commented Jan 8, 2025

This PR updates the rrweb sampling options depending on the userAgent as this tends to block the main thread on iOS browsers.

closes #14534

@chargome chargome self-assigned this Jan 8, 2025
Copy link
Contributor

github-actions bot commented Jan 8, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 22.74 KB - -
@sentry/browser - with treeshaking flags 21.51 KB - -
@sentry/browser (incl. Tracing) 35.39 KB - -
@sentry/browser (incl. Tracing, Replay) 72.19 KB +0.14% +99 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 62.71 KB +0.15% +93 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 76.45 KB +0.13% +100 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 88.48 KB +0.12% +105 B 🔺
@sentry/browser (incl. Feedback) 39.07 KB - -
@sentry/browser (incl. sendFeedback) 27.42 KB - -
@sentry/browser (incl. FeedbackAsync) 32.25 KB - -
@sentry/react 25.49 KB - -
@sentry/react (incl. Tracing) 38.15 KB - -
@sentry/vue 27.08 KB - -
@sentry/vue (incl. Tracing) 37.24 KB - -
@sentry/svelte 22.86 KB - -
CDN Bundle 24.12 KB - -
CDN Bundle (incl. Tracing) 35.7 KB - -
CDN Bundle (incl. Tracing, Replay) 70.35 KB +0.15% +104 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 75.55 KB +0.12% +92 B 🔺
CDN Bundle - uncompressed 70.47 KB - -
CDN Bundle (incl. Tracing) - uncompressed 106.04 KB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 217.09 KB +0.08% +177 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 229.84 KB +0.08% +177 B 🔺
@sentry/nextjs (client) 38.28 KB - -
@sentry/sveltekit (client) 35.9 KB - -
@sentry/node 161.47 KB +0.01% +1 B 🔺
@sentry/node - without tracing 97.28 KB +0.01% +2 B 🔺
@sentry/aws-serverless 127.12 KB - -

View base workflow run

export function getRecordingSamplingOptions(): Partial<{ sampling: { mousemove: boolean } }> {
if (
/iPhone|iPad|iPod/i.test(NAVIGATOR?.userAgent ?? '') ||
(/Macintosh/i.test(NAVIGATOR?.userAgent ?? '') && NAVIGATOR?.maxTouchPoints && NAVIGATOR?.maxTouchPoints > 1)
Copy link
Member

Choose a reason for hiding this comment

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

Does this disable for desktop safari?

Copy link
Member Author

Choose a reason for hiding this comment

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

@chargome chargome marked this pull request as ready for review January 8, 2025 16:42
@chargome chargome requested a review from a team as a code owner January 8, 2025 16:42
@chargome chargome merged commit b23fcd1 into develop Jan 8, 2025
161 checks passed
@chargome chargome deleted the cg/replay-mousemove-sampling-ios branch January 8, 2025 17:44
chargome added a commit that referenced this pull request Jan 8, 2025
…4937)

This PR updates the rrweb sampling options depending on the userAgent as
this tends to block the main thread on iOS browsers.

closes #14534
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replay feature appears to be interfering with iOS browser/webview click events
3 participants