getsentry / getsentry/sentry

Slack notifications: feedback issue titles containing newlines render as raw mrkdwn instead of a link

Open
#121,520 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Good First Issue Product Area: Settings - Integrations Waiting for: Product Owner
Dominant language
Python
Stars
44.8k
Forks
4.9k
Avg merge
21h 23m
Merged PRs (30d)
607

Description

Environment

SaaS (https://sentry.io/)

Steps to Reproduce
  1. Install the Slack integration and add an issue alert that posts new User Feedback issues to a Slack channel.

  2. Submit user feedback whose message contains line breaks. For example, via the Android SDK:

    Sentry.feedback().capture(Feedback("the app freezes on checkout\n\nreproduced twice"))
    
  3. Open the resulting Slack notification.

Expected Result

The notification renders a clickable link to the feedback, the same as it does when the feedback message is a single line.

Actual Result

The link prints as literal mrkdwn text, and nothing in the message is clickable:

<https://<org>.sentry.io/feedback/?referrer=slack&notification_uid=…&workflow_id=…&alert_type=issue&feedbackSlug=…&project=…|*User Feedback: the app freezes on checkout

reproduced twice*>

Cause: Sentry titles a feedback issue User Feedback: <message verbatim>, so any newline the reporter typed becomes part of the issue title. The Slack message builder then interpolates that title into mrkdwn link syntax (<url|*title*>), and Slack only parses that syntax when the label sits on a single line. Feedback submitted as one line is unaffected, so this only shows up for multiline reports.

Suggested fix: sanitize the link label when building the Slack message, by collapsing or escaping newlines, or by truncating the title to its first line.

Possibly related: getsentry/sentry#109694, where bold formatting inside a link breaks rendering on Slack mobile. Both originate from the same <url|*title*> pattern in the Slack message builders.

Product Area

Alerts

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Slack message builders that interpolate the <url|*title*> pattern, then trace how feedback issue titles enter that label. Reproduce the case with a multiline feedback message and verify that the resulting notification renders a clickable feedback link while single-line feedback remains unaffected.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.