Skip to content

Commit f7e1b98

Browse files
authored
🔧 chore: max slack plugin title length (#96727)
1 parent 145baf7 commit f7e1b98

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/sentry_plugins/slack/plugin.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
status.HTTP_429_TOO_MANY_REQUESTS,
2525
]
2626

27+
SLACK_PLUGIN_TITLE_LENGTH_LIMIT = 256
28+
2729

2830
class SlackPlugin(CorePluginMixin, notify.NotificationPlugin):
2931
title = "Slack"
@@ -166,7 +168,7 @@ def notify(self, notification: Notification, raise_exception: bool = False) -> N
166168
if not self.is_configured(project):
167169
return
168170

169-
title = event.title.encode("utf-8")
171+
title = event.title[:SLACK_PLUGIN_TITLE_LENGTH_LIMIT].encode("utf-8")
170172
# TODO(dcramer): we'd like this to be the event culprit, but Sentry
171173
# does not currently retain it
172174
if group.culprit:

0 commit comments

Comments
 (0)