fix(core): Deduplicate sentry events using error stacktraces instead (no-changelog) (#10590)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2024-08-28 15:31:29 +02:00 committed by GitHub
parent 95a9cd2c73
commit 3b43ff69a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;
});