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(replay): Do not mangle _metadata in client options #6600

Merged
merged 1 commit into from
Dec 22, 2022

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Dec 21, 2022

When working on #6514 I missed that we access a "private" field in client.getOptions()._metadata to retrieve the SDK name. This had the consequence that - once again - we mangled a cross-package field we shouldn't (_metadata) in our CDN bundles which caused the SDK name to not be included in the replay event and envelope.

This caused minified CDN bundles to send incomplete replay event envelopes to Sentry and as a consequence, they were not processed (correctly) and hence users didn't get incoming replays.

This PR excludes the _metadata field from being mangled. Before merging this, I wanna see how much bundle size increase this causes. If it's too much, we can also revert #6514.

h/t @souredoutlook for raising this issue.

@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 19.79 KB (+0.02% 🔺)
@sentry/browser - ES5 CDN Bundle (minified) 61.3 KB (+0.06% 🔺)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.57 KB (+0.02% 🔺)
@sentry/browser - ES6 CDN Bundle (minified) 54.84 KB (+0.07% 🔺)
@sentry/browser - Webpack (gzipped + minified) 20.34 KB (0%)
@sentry/browser - Webpack (minified) 66.48 KB (0%)
@sentry/react - Webpack (gzipped + minified) 20.36 KB (0%)
@sentry/nextjs Client - Webpack (gzipped + minified) 47.56 KB (0%)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 26.75 KB (-0.01% 🔽)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 25.19 KB (+0.02% 🔺)
@sentry/replay ES6 CDN Bundle (gzipped + minified) 42.09 KB (+0.01% 🔺)
@sentry/replay - Webpack (gzipped + minified) 38.17 KB (0%)

@Lms24 Lms24 merged commit de8cf10 into master Dec 22, 2022
@Lms24 Lms24 deleted the lms-fix-replay-metadata branch December 22, 2022 07:56
Lms24 added a commit that referenced this pull request Jan 4, 2023
Add a new method to the `Client` interface: `getSdkMetadata`.
We can use this method in the Replay package to avoid accessing `client.getOptions()._metadata`, which previously caused broken CDN bundles which we hot-fixed with #6600. This change now properly fixes this issue by simply not accessing this "private" field anymore.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants