From 3b43ff69a75b90ddebb1b9145d635606e65a86cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Wed, 28 Aug 2024 15:31:29 +0200 Subject: [PATCH] fix(core): Deduplicate sentry events using error stacktraces instead (no-changelog) (#10590) --- packages/cli/src/error-reporting.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/cli/src/error-reporting.ts b/packages/cli/src/error-reporting.ts index a8b25c891d..d211e4d15a 100644 --- a/packages/cli/src/error-reporting.ts +++ b/packages/cli/src/error-reporting.ts @@ -82,9 +82,11 @@ export const initErrorHandling = async () => { if (tags) event.tags = { ...event.tags, ...tags }; } - const eventHash = createHash('sha1').update(JSON.stringify(originalException)).digest('base64'); - if (seenErrors.has(eventHash)) return null; - seenErrors.add(eventHash); + if (originalException instanceof Error && originalException.stack) { + const eventHash = createHash('sha1').update(originalException.stack).digest('base64'); + if (seenErrors.has(eventHash)) return null; + seenErrors.add(eventHash); + } return event; });