Skip to content

fix(slack-notify): fit messages into Slack's 4,000-character limit - #19

Open
tyhonchik wants to merge 1 commit into
mainfrom
fix/slack-notify-length-limit
Open

tyhonchik wants to merge 1 commit into
mainfrom
fix/slack-notify-length-limit

Conversation

@tyhonchik

Copy link
Copy Markdown
Contributor

chat.update rejects text over 4,000 characters with msg_too_long. Release head updates (start, refresh, complete) send the full changelog, so a long release leaves the head message stale. The app-backend v0.41.0 refresh sent 5.7K characters and failed. Nobody saw it because the step is continue-on-error and the script dropped the Slack error.

  • truncateText cuts the mrkdwn text at the last line break that fits, marks the cut and keeps a short closing paragraph, where release flags such as the DB-migration warning live. Messages under the limit go out unchanged.
  • On failure the step prints the Slack error.

Checked on the v0.41.0 message: 5725 → 3992 characters, migration flag kept.

🤖 Generated with Claude Code

chat.update rejects longer text with msg_too_long, so a long release changelog left the release head message stale. Cut at a line break, keep a short closing paragraph (the DB-migration flag) and log the Slack error.
.catch(() => {
console.error('Failed to send Slack message.');
.catch((error) => {
console.error(`Failed to send Slack message: ${error.message}`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants