Skip to content

Commit 97ae8e2

Browse files
committed
Reset DedupeIntegrations last-seen if before_send dropped the event
1 parent 5dcda1d commit 97ae8e2

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

sentry_sdk/client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,10 @@ def _prepare_event(
606606
self.transport.record_lost_event(
607607
"before_send", data_category="error"
608608
)
609+
from sentry_sdk.integrations.dedupe import DedupeIntegration
610+
611+
DedupeIntegration.reset_last_seen()
612+
609613
event = new_event
610614

611615
before_send_transaction = self.options["before_send_transaction"]

sentry_sdk/integrations/dedupe.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,11 @@ def processor(event, hint):
4040
return None
4141
integration._last_seen.set(exc)
4242
return event
43+
44+
@staticmethod
45+
def reset_last_seen():
46+
integration = sentry_sdk.get_client().get_integration(DedupeIntegration)
47+
if integration is None:
48+
return
49+
50+
integration._last_seen.set(None)

0 commit comments

Comments
 (0)