Skip to content

fix(replay): Ensure console breadcrumb args are truncated - #7917

Merged
mydea merged 8 commits into
developfrom
fn/truncate-console-breadcrumbs
Apr 24, 2023
Merged

fix(replay): Ensure console breadcrumb args are truncated#7917
mydea merged 8 commits into
developfrom
fn/truncate-console-breadcrumbs

Conversation

@mydea

@mydeamydea commented Apr 20, 2023

Copy link
Copy Markdown
Member

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

@mydeamydea self-assigned this Apr 20, 2023
@github-actions

github-actionsBot commented Apr 20, 2023

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
@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% 🔺)

@mydea
mydeaforce-pushed the fn/truncate-console-breadcrumbs branch from 454a756 to ad13981CompareApril 20, 2023 14:33
Comment threadpackages/replay/src/coreHandlers/handleScope.ts Outdated
@mydea
mydeaforce-pushed the fn/truncate-console-breadcrumbs branch from ad13981 to 8295ecbCompareApril 21, 2023 08:27
@mydea
mydeaforce-pushed the fn/truncate-console-breadcrumbs branch 2 times, most recently from 1a8f4a9 to d2a86c5CompareApril 21, 2023 11:39
@mydea
mydeaforce-pushed the fn/truncate-console-breadcrumbs branch from 8c578be to 6548ac9CompareApril 24, 2023 06:38
@mydea
mydea merged commit 24a235d into developApr 24, 2023
@mydea
mydea deleted the fn/truncate-console-breadcrumbs branch April 24, 2023 07:07
Sign up for freeto 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.

Add truncation to console logs messages

3 participants

@mydea@billyvg@AbhiPrasad