fix: truncate error message in backup notifications to 1010 characters#4023
Merged
Siumauricio merged 2 commits intocanaryfrom Mar 18, 2026
Conversation
- Updated the error message formatting in both database and volume backup notification functions to limit the displayed message length, ensuring better readability and preventing overflow.
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this PR about?
Please describe in a short paragraph what this PR is about.
Checklist
Before submitting this PR, please make sure that:
canarybranch.Issues related (if applicable)
closes #4021
Screenshots (if applicable)
Greptile Summary
This PR truncates the
errorMessageto 1010 characters in Discord backup failure notifications for both database and volume backups, preventing Discord from rejecting embed field values that exceed its 1024-character limit (1010 content + 6 surrounding backtick characters = 1016, safely under the cap).Key observations:
errorMessage. Pushover in particular enforces a hard 1024-character message limit, which could cause API failures for long error strings....) is appended when the message is cut off, so Discord users have no way to tell the notification is incomplete.teamsandlarkalready had their own truncation (500 and 800 characters respectively); the fix is consistent with that pattern but only for the Discord channel.Confidence Score: 4/5
...indicator, untruncated messages to Pushover/Slack/Telegram/etc.) are pre-existing gaps not introduced by this PR, though they are worth addressing in a follow-up.Comments Outside Diff (1)
packages/server/src/utils/notifications/database-backup.ts, line 228-236 (link)This PR fixes truncation only for Discord. However, the same untruncated
errorMessageis also passed to:attachmentsfield values have a 2000-character limit.For comparison,
teams(line 430) andlark(lines 296–299) already apply their own truncation. The same gap exists involume-backup.tsat the corresponding lines.Last reviewed commit: "fix: truncate error ..."