Skip to content
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

fix(web-vitals): Check for valid entry in updatedCLS #3816

Merged
merged 3 commits into from
Jul 19, 2021

Conversation

AbhiPrasad
Copy link
Member

As per comment in #2925 (comment)

Still not sure why this happens, but would like to continue to test on Sentry.

@AbhiPrasad AbhiPrasad requested a review from kamilogorek as a code owner July 19, 2021 14:20
@@ -43,7 +43,8 @@ export const getUpdatedCLS = (onReport: ReportHandler, reportAllChanges?: boolea

const entryHandler = (entry: LayoutShift): void => {
// Only count layout shifts without recent user input.
if (!entry.hadRecentInput) {
// TODO: Figure out why entry can be undefined
if (entry && !entry.hadRecentInput) {
Copy link
Member

Choose a reason for hiding this comment

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

@AbhiPrasad you'll also want to check if sessionEntries is a non-empty array on line 54. lastSessionEntry could be undefined as well

@github-actions
Copy link
Contributor

github-actions bot commented Jul 19, 2021

size-limit report

Path Size
@sentry/browser - CDN Bundle (gzipped) 21.46 KB (-0.01% 🔽)
@sentry/browser - Webpack 22.47 KB (0%)
@sentry/react - Webpack 22.5 KB (0%)
@sentry/browser + @sentry/tracing - CDN Bundle (gzipped) 28.97 KB (+0.02% 🔺)

@AbhiPrasad AbhiPrasad enabled auto-merge (squash) July 19, 2021 15:14
@AbhiPrasad AbhiPrasad merged commit f8a4d60 into master Jul 19, 2021
@AbhiPrasad AbhiPrasad deleted the abhi-updated-cls-check branch July 19, 2021 15:43
@tjk tjk mentioned this pull request Jul 20, 2021
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.

3 participants