Skip to content

Commit

Permalink
fix(core): Deduplicate sentry events using error stacktraces instead …
Browse files Browse the repository at this point in the history
…(no-changelog)
  • Loading branch information
netroy committed Aug 28, 2024
1 parent 95a9cd2 commit daee3d1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/cli/src/error-reporting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand Down

0 comments on commit daee3d1

Please sign in to comment.