From 5ac32b3713232b06841e0f1846d54e894bf74548 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gast=C3=B3n=20Fournier?= Date: Tue, 24 Sep 2024 11:43:08 +0200 Subject: [PATCH] chore: send full message without trimming to the addon event (#8230) Address https://github.com/Unleash/unleash/pull/8219#discussion_r1772884465 --- src/lib/addons/slack.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/addons/slack.ts b/src/lib/addons/slack.ts index c2699fd3b0..51f992b84e 100644 --- a/src/lib/addons/slack.ts +++ b/src/lib/addons/slack.ts @@ -75,7 +75,8 @@ export default class SlackAddon extends Addon { const { text: formattedMessage, url: featureLink } = this.msgFormatter.format(event); - const text = formattedMessage.substring(0, 3000); + const maxLength = 3000; + const text = formattedMessage.substring(0, maxLength); const requests = slackChannels.map((channel) => { const body = { username, @@ -149,7 +150,7 @@ export default class SlackAddon extends Addon { url, channels: slackChannels, username, - message: text, + message: `${formattedMessage}${text.length < formattedMessage.length ? ` (trimmed to ${maxLength} characters)` : ''}`, }, }); }