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): Ensure console breadcrumb args are truncated #7917

Merged
merged 8 commits into from Apr 24, 2023

Conversation

mydea
Copy link
Member

@mydea mydea commented Apr 20, 2023

This uses the new fixJson util to also truncate console log breadcrumbs for replay.

It adds a data._meta.warnings = ['CONSOLE_ARG_TRUNCATED'] to the breadcrumb if it has truncated at least one arg.

I also added a test that fails before this PR - it logs a massive object to the console, which leads to the test timing out previously, but works with this change.

Closes #7677
ref https://github.com/getsentry/team-replay/issues/67

@github-actions
Copy link
Contributor

github-actions bot commented Apr 20, 2023

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 21.02 KB (+0.01% 🔺)
@sentry/browser - ES5 CDN Bundle (minified) 65.66 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 19.56 KB (-0.01% 🔽)
@sentry/browser - ES6 CDN Bundle (minified) 58.12 KB (0%)
@sentry/browser - Webpack (gzipped + minified) 21.17 KB (0%)
@sentry/browser - Webpack (minified) 69.07 KB (0%)
@sentry/react - Webpack (gzipped + minified) 21.19 KB (0%)
@sentry/nextjs Client - Webpack (gzipped + minified) 49.03 KB (0%)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 28.59 KB (+0.01% 🔺)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 26.82 KB (+0.01% 🔺)
@sentry/replay ES6 CDN Bundle (gzipped + minified) 46.21 KB (+0.36% 🔺)
@sentry/replay - Webpack (gzipped + minified) 40.09 KB (+0.41% 🔺)
@sentry/browser + @sentry/tracing + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 65.07 KB (+0.25% 🔺)
@sentry/browser + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 58.05 KB (+0.27% 🔺)

packages/replay/src/coreHandlers/handleScope.ts Outdated Show resolved Hide resolved
@mydea mydea force-pushed the fn/truncate-console-breadcrumbs branch from ad13981 to 8295ecb Compare April 21, 2023 08:27
@mydea mydea force-pushed the fn/truncate-console-breadcrumbs branch 2 times, most recently from 1a8f4a9 to d2a86c5 Compare April 21, 2023 11:39
@mydea mydea force-pushed the fn/truncate-console-breadcrumbs branch from 8c578be to 6548ac9 Compare April 24, 2023 06:38
@mydea mydea merged commit 24a235d into develop Apr 24, 2023
59 checks passed
@mydea mydea deleted the fn/truncate-console-breadcrumbs branch April 24, 2023 07:07
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.

Add truncation to console logs messages
3 participants