Repository navigation
fix(browser): Attribute long animation frame spans to the longest script - #25990
Merged
Merged
Conversation
The span took its invoker and source attributes from the first script of the frame. When a short listener ran first, such as the SDK's own INP listener on `mousedown`, the frame was attributed to that listener instead of the script that blocked it. This also made the long-tasks-and-animation-frame event listener browser test flaky.
Contributor
size-limit report 📦Compared: 62edddc (PR test merge using develop at 34dfa4d) Against: 34dfa4d (develop) · base run #64564 ✅ Baseline matches: this diff contains only this PR's changes.
|
Contributor
Optional E2E testsSome optional checks were not successful. They do not block the merge. 1 not successful, 22 successful. See the run.
Successful checks
|
mydea
marked this pull request as ready for review
November 4, 2026 16:44
mydea
requested review from
Lms24 and
logaretm
and removed request for
a team
November 4, 2026 16:44
logaretm
approved these changes
Nov 4, 2026
51 tasks done
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.
Why:
long-tasks-and-animation-frame-enabled-static› "should capture long animation frame for event listener" failed in 3developruns last week (weekly report). In the Playwright trace from one failure, the click frame's span was there, but its invoker wasDOMWindow.onmousedown, insentryWrappedin the SDK bundle. That's the SDK's own capture-phase INP listener, notBUTTON#clickme.onclick, which blocks for 105ms. The span takes its attributes fromentry.scripts[0]. The browser only lists scripts that run longer than 5ms, so on a loaded runner the SDK'smousedownlistener sometimes crosses that bar and becomes the first entry.The same thing can happen in production: a frame blocked by app code gets blamed on our own listener. This change uses the script with the longest
durationinstead. That's also how web-vitals' INP attribution pickslongestScript. The new unit test fails ondevelopand passes with the fix. The long task and LoAF browser suites pass locally on Chromium.Unsure about: this changes which script the
browser.script.*/code.*attributes describe, so it's a small behavior change rather than a test-only fix. If you'd rather keepscripts[0], the alternative is to loosen the browser test. I kept it infixscope for that reason.via automation
sched_91b21536e9d59370f48bbec448287393· Run IDsched_91b21536e9d59370f48bbec448287393:1793610000000.--
View Session [Sentry]