Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/sentry/integrations/slack/webhooks/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ def _get_unfurlable_links(

# Link can't be unfurled
if link_type is None or args is None:
lifecycle.record_halt("Unfurlable link", extra={"url": url})
continue

Comment on lines 189 to 190
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Removing lifecycle.record_halt() for unfurlable links causes IntegrationEventLifecycle to incorrectly record them as SUCCESS instead of HALTED.
Severity: CRITICAL | Confidence: High

🔍 Detailed Analysis

When a link cannot be unfurled (i.e., link_type is None or args is None), the removal of lifecycle.record_halt() prevents explicit state setting. Due to the IntegrationEventLifecycle context's default assume_success=True, the event is incorrectly recorded as SUCCESS upon context exit instead of HALTED. This misrepresents the actual success rate of Slack integration's link unfurling, leading to corrupted metrics and misleading operational data.

💡 Suggested Fix

Either restore lifecycle.record_halt() and implement sampling/filtering to reduce noise, or initialize the IntegrationEventLifecycle context with assume_success=False to ensure unhandled exits default to HALTED.

🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: src/sentry/integrations/slack/webhooks/event.py#L189-L190

Potential issue: When a link cannot be unfurled (i.e., `link_type is None or args is
None`), the removal of `lifecycle.record_halt()` prevents explicit state setting. Due to
the `IntegrationEventLifecycle` context's default `assume_success=True`, the event is
incorrectly recorded as `SUCCESS` upon context exit instead of `HALTED`. This
misrepresents the actual success rate of Slack integration's link unfurling, leading to
corrupted metrics and misleading operational data.

Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 4620354

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's correct :)

if (
Expand Down
Loading