feat(notifications): Add notification data and renderer for metric alerts#111674
1 issue
sentry-backend-bugs: Found 1 issue (1 medium)
Medium
Activity.objects.get() missing DoesNotExist handler causes notification failures - `src/sentry/notifications/platform/slack/renderers/metric_alert.py:51`
The Activity.objects.get(id=data.activity_id) call has no exception handling. When an activity is deleted between notification creation and rendering, this raises Activity.DoesNotExist. The notification will fail silently and create a Sentry issue.
Also found at:
src/sentry/notifications/platform/slack/renderers/metric_alert.py:52src/sentry/notifications/platform/slack/renderers/metric_alert.py:72
Duration: 3m 22s · Tokens: 1.1M in / 16.5k out · Cost: $1.47 (+extraction: $0.00, +merge: $0.00)
Annotations
Check warning on line 51 in src/sentry/notifications/platform/slack/renderers/metric_alert.py
sentry-warden / warden: sentry-backend-bugs
Activity.objects.get() missing DoesNotExist handler causes notification failures
The `Activity.objects.get(id=data.activity_id)` call has no exception handling. When an activity is deleted between notification creation and rendering, this raises `Activity.DoesNotExist`. The notification will fail silently and create a Sentry issue.
Check warning on line 52 in src/sentry/notifications/platform/slack/renderers/metric_alert.py
sentry-warden / warden: sentry-backend-bugs
[PN2-B8B] Activity.objects.get() missing DoesNotExist handler causes notification failures (additional location)
The `Activity.objects.get(id=data.activity_id)` call has no exception handling. When an activity is deleted between notification creation and rendering, this raises `Activity.DoesNotExist`. The notification will fail silently and create a Sentry issue.
Check warning on line 72 in src/sentry/notifications/platform/slack/renderers/metric_alert.py
sentry-warden / warden: sentry-backend-bugs
[PN2-B8B] Activity.objects.get() missing DoesNotExist handler causes notification failures (additional location)
The `Activity.objects.get(id=data.activity_id)` call has no exception handling. When an activity is deleted between notification creation and rendering, this raises `Activity.DoesNotExist`. The notification will fail silently and create a Sentry issue.