Skip to content

fix(replay): Treat mutations in the same millisecond as a click as non-slow - #25610

Open
mydea wants to merge 1 commit into
developfrom
fix/replay-same-ms-slow-click
Open

mydea wants to merge 1 commit into
developfrom
fix/replay-same-ms-slow-click

Conversation

@mydea

@mydea mydea commented Oct 21, 2026

Copy link
Copy Markdown
Member

Fixes flaky suites/replay/slowClick/mutation ("immediate mutation does not trigger slow click") and suites/replay/slowClick/multiClick ("captures multiple multi clicks") tests, which were surfacing a real bug.

Sentry's click listener runs before the user's handler, so the click breadcrumb is timestamped first and the rrweb mutation event follows a microtask later. Both use Date.now() (ms precision), so they regularly land in the same millisecond, giving mutationAfter === 0. That was treated as falsy, i.e. "no mutation", and the click was reported as a slow click (and, in the multi click test, not as a ui.multiClick). The same applied to scrollAfter. We now check for undefined instead.

The multi click test additionally waited only 1001ms (in Node) between bursts, racing the browser's 1000ms breadcrumb debounce timer; bumped to 1500ms, still well below the 3.5s slow click timeout.

🤖 Generated with Claude Code

…n-slow

`mutationAfter`/`scrollAfter` of `0` were treated as falsy, so a mutation or
scroll landing in the same millisecond as the click breadcrumb was ignored and
the click reported as slow. This made the slow/multi click integration tests
flaky. Also give the multi click test more slack for the browser's 1s
breadcrumb debounce timer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Compared: 817c035 (PR test merge using develop at 7a19df2)

Against: 7a19df2 (develop) · base run #62902

✅ Baseline matches: this diff contains only this PR's changes.

Path Size % Change Change
@sentry/browser 29.91 kB - -
@sentry/browser - with treeshaking flags 28.05 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.95 kB - -
@sentry/browser (incl. Tracing) 52.1 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 52.1 kB - -
@sentry/browser (incl. Tracing, Profiling) 55.05 kB - -
@sentry/browser (incl. Tracing, Replay) 91.85 kB +0.01% +3 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 80.72 kB +0.01% +7 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 96.58 kB +0.01% +3 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 109.52 kB +0.01% +3 B 🔺
@sentry/browser (incl. Feedback) 47.42 kB - -
@sentry/browser (incl. sendFeedback) 34.97 kB - -
@sentry/browser (incl. FeedbackAsync) 40.07 kB - -
@sentry/browser (incl. Metrics) 30.93 kB - -
@sentry/browser (incl. Logs) 31.21 kB - -
@sentry/browser (incl. Metrics & Logs) 31.84 kB - -
@sentry/react 31.73 kB - -
@sentry/react (incl. Tracing) 54.41 kB - -
@sentry/vue 38.07 kB - -
@sentry/vue (incl. Tracing) 55.03 kB - -
@sentry/svelte 29.93 kB - -
@sentry/remix (Remix 3 client bundle) 57.11 kB - -
CDN Bundle 31.67 kB - -
CDN Bundle (incl. Tracing) 52.61 kB - -
CDN Bundle (incl. Logs, Metrics) 33.87 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 54.55 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 74.8 kB +0.01% +6 B 🔺
CDN Bundle (incl. Tracing, Replay) 90.29 kB +0.01% +9 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 92.22 kB +0.01% +8 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 96.43 kB +0.01% +8 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 98.38 kB +0.01% +7 B 🔺
CDN Bundle - uncompressed 93.29 kB - -
CDN Bundle (incl. Tracing) - uncompressed 156.14 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 99.84 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 162.11 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 229.91 kB +0.02% +34 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 276.34 kB +0.02% +34 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 282.3 kB +0.02% +34 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 290.05 kB +0.02% +34 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 295.99 kB +0.02% +34 B 🔺
@sentry/nextjs (client) 57.31 kB - -
@sentry/sveltekit (client) 52.48 kB - -
@sentry/core/server 41.8 kB - -
@sentry/core/browser 13.81 kB - -
@sentry/node 155.32 kB +0.01% +1 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 84.06 kB - -
@sentry/node - without tracing 96.95 kB +0.01% +1 B 🔺
@sentry/node - without channel injection 133.3 kB +0.01% +1 B 🔺
@sentry/aws-serverless 105.13 kB +0.01% +1 B 🔺
@sentry/cloudflare (withSentry) - minified 211.11 kB - -
@sentry/cloudflare (withSentry) 523.83 kB - -
@sentry/nextjs/cloudflare (withSentry) - minified 230.74 kB - -

View base workflow run

@mydea
mydea marked this pull request as ready for review October 21, 2026 12:01
@mydea
mydea requested a review from a team as a code owner October 21, 2026 12:01
@mydea
mydea requested review from Lms24 and logaretm and removed request for a team October 21, 2026 12:01

This branch has not been deployed

No deployments
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.

1 participant