Conversation
Lms24
added this pull request to stack #24904
October 2, 2026 12:58
The replay CLS event used the CLS score as its timestamp, so it always landed a fraction of a millisecond after page load. Use the start time of the last layout shift instead, like the CLS span in tracing does. This also picks the time origin from when the shift happened. Co-Authored-By: Claude <noreply@anthropic.com>
Like CLS, the replay INP event used the metric value as its timestamp. For INP that value is a duration, so the event landed shortly after page load. Use the start time of the interaction instead. Co-Authored-By: Claude <noreply@anthropic.com>
Lms24
force-pushed
the
lms/fix-replay-cls-timestamp
branch
from
October 2, 2026 14:13
53c97f7 to
10bc6d6
Compare
Lms24
marked this pull request as ready for review
October 2, 2026 14:15
Lms24
requested review from
logaretm and
msonnb
and removed request for
a team
October 2, 2026 14:15
Contributor
size-limit report 📦
|
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.
The Replay integration adding web vital breadcrumbs used the metric value as the timestamp for CLS and INP web vitals. This is incorrect because that value is a score for CLS and a duration for INP, so both events always landed just after page load. This was a pre-existing bug, but it showed up during work on #23054. With this PR, CLS goes at the last layout shift and INP at the interaction, like we already do with spans in tracing. Both also get the time origin from when that happened, so they stay correct after a clock drift correction. A CLS of 0 has no layout shift, so it stays at the time origin.