Skip to content

Commit 653f4de

Browse files
kevinehosfordkamilogorek
authored andcommitted
feat: port fingerprint check to dedupe integration
1 parent 2a87bf9 commit 653f4de

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

packages/browser/src/integrations/dedupe.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ export class Dedupe implements Integration {
6161
return true;
6262
}
6363

64+
if (this.isSameFingerprint(event)) {
65+
logger.warn(
66+
`Event dropped due to being a duplicate of previous event (same fingerprint).\n Event: ${event.event_id}`,
67+
);
68+
return true;
69+
}
70+
6471
return false;
6572
}
6673

@@ -144,4 +151,14 @@ export class Dedupe implements Integration {
144151

145152
return this.isSameStacktrace(event);
146153
}
154+
155+
/** JSDoc */
156+
private isSameFingerprint(event: SentryEvent): boolean {
157+
if (!this.previousEvent) {
158+
return false;
159+
}
160+
161+
return Boolean(event.fingerprint && this.previousEvent.fingerprint) &&
162+
JSON.stringify(event.fingerprint) === JSON.stringify(this.previousEvent.fingerprint)
163+
}
147164
}

0 commit comments

Comments
 (0)