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(tracing): Filter out invalid resource sizes #9641

Merged
merged 2 commits into from
Nov 22, 2023

Conversation

AbhiPrasad
Copy link
Member

@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 DominikB2014, a team, anonrig and stephanie-anderson and removed request for a team November 22, 2023 16:40
Copy link
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
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
Member 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
87 checks passed
@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