Skip to content

fix(tracing): Filter out invalid resource sizes#9641

Merged
AbhiPrasad merged 2 commits intodevelopfrom
abhi-filter-invalid-sizes
Nov 22, 2023
Merged

fix(tracing): Filter out invalid resource sizes#9641
AbhiPrasad merged 2 commits intodevelopfrom
abhi-filter-invalid-sizes

Conversation

@AbhiPrasad
Copy link
Copy Markdown
Contributor

@AbhiPrasad AbhiPrasad commented Nov 22, 2023

There's a bug in some browsers that attaches huge resource sizes that are completely unrealistic. Here's an example in chromium: https://bugs.chromium.org/p/chromium/issues/detail?id=1324812#c25

To get around this, we add a filter to enforce that resource sizes should only be attached if the size is < 2147483647 bytes (size of maximum value of integer in c/c++).

@mydea should we add this to replay as well? Maybe a good time to unify the resource entry handling logic.

@AbhiPrasad AbhiPrasad requested review from a team, DominikB2014, anonrig and stephanie-anderson and removed request for a team November 22, 2023 16:40
@github-actions
Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
@sentry/browser (incl. Tracing, Replay) - Webpack (gzipped) 66.04 KB (+0.04% 🔺)
@sentry/browser (incl. Tracing, Replay) - Webpack with treeshaking flags (gzipped) 56.15 KB (+0.08% 🔺)
@sentry/browser (incl. Tracing) - Webpack (gzipped) 31.15 KB (+0.14% 🔺)
@sentry/browser - Webpack (gzipped) 21.41 KB (0%)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (gzipped) 62.43 KB (+0.04% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (gzipped) 29.26 KB (+0.07% 🔺)
@sentry/browser - ES6 CDN Bundle (gzipped) 21.37 KB (0%)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (minified & uncompressed) 196.85 KB (+0.01% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (minified & uncompressed) 88.74 KB (+0.02% 🔺)
@sentry/browser - ES6 CDN Bundle (minified & uncompressed) 63.69 KB (0%)
@sentry/browser (incl. Tracing) - ES5 CDN Bundle (gzipped) 32 KB (+0.08% 🔺)
@sentry/react (incl. Tracing, Replay) - Webpack (gzipped) 66.35 KB (+0.05% 🔺)
@sentry/react - Webpack (gzipped) 21.45 KB (0%)
@sentry/nextjs Client (incl. Tracing, Replay) - Webpack (gzipped) 83.13 KB (+0.06% 🔺)
@sentry/nextjs Client - Webpack (gzipped) 48.29 KB (+0.07% 🔺)
@sentry-internal/feedback - Webpack (gzipped) 16.19 KB (0%)

@AbhiPrasad AbhiPrasad requested a review from mydea November 22, 2023 17:04
Copy link
Copy Markdown
Contributor

@DominikB2014 DominikB2014 left a comment

Choose a reason for hiding this comment

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

Should we update our resource module docs and write this as a min SDK version, or at least note that this fixes some issues with weird sizes. Not sure how we typically handle this, but if we should update docs, i can do so!

@AbhiPrasad
Copy link
Copy Markdown
Contributor Author

Maybe a troubleshooting section in the docs? Maybe we can link to that in the product when we detect a resource size that looks strange.

@AbhiPrasad AbhiPrasad merged commit 08818d8 into develop Nov 22, 2023
@AbhiPrasad AbhiPrasad deleted the abhi-filter-invalid-sizes branch November 22, 2023 17:40
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