Repository navigation
Conversation
…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>
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.
|
mydea
marked this pull request as ready for review
October 21, 2026 12:01
mydea
requested review from
Lms24 and
logaretm
and removed request for
a team
October 21, 2026 12:01
Lms24
approved these changes
Oct 22, 2026
Comment on lines
+186
to
+189
| if (click.mutationAfter === undefined && this._lastMutation) { | ||
| click.mutationAfter = click.timestamp <= this._lastMutation ? this._lastMutation - click.timestamp : undefined; | ||
| } | ||
| if (!click.scrollAfter && this._lastScroll) { | ||
| if (click.scrollAfter === undefined && this._lastScroll) { |
Member
There was a problem hiding this comment.
l: slightly more size-efficient:
Suggested change
| if (click.mutationAfter === undefined && this._lastMutation) { | |
| click.mutationAfter = click.timestamp <= this._lastMutation ? this._lastMutation - click.timestamp : undefined; | |
| } | |
| if (!click.scrollAfter && this._lastScroll) { | |
| if (click.scrollAfter === undefined && this._lastScroll) { | |
| if (click.mutationAfter == null && this._lastMutation) { | |
| click.mutationAfter = click.timestamp <= this._lastMutation ? this._lastMutation - click.timestamp : undefined; | |
| } | |
| if (click.scrollAfter == null && this._lastScroll) { |
Comment on lines
+218
to
+219
| const hadScroll = click.scrollAfter !== undefined && click.scrollAfter <= this._scrollTimeout; | ||
| const hadMutation = click.mutationAfter !== undefined && click.mutationAfter <= this._threshold; |
Member
There was a problem hiding this comment.
Suggested change
| const hadScroll = click.scrollAfter !== undefined && click.scrollAfter <= this._scrollTimeout; | |
| const hadMutation = click.mutationAfter !== undefined && click.mutationAfter <= this._threshold; | |
| const hadScroll = click.scrollAfter != null && click.scrollAfter <= this._scrollTimeout; | |
| const hadMutation = click.mutationAfter != null && click.mutationAfter <= this._threshold; |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes flaky
suites/replay/slowClick/mutation("immediate mutation does not trigger slow click") andsuites/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, givingmutationAfter === 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 aui.multiClick). The same applied toscrollAfter. We now check forundefinedinstead.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