Truncate notifications when saving to db
Some checks are pending
system-test / waitForNative (push) Waiting to run
system-test / buildMockserver (push) Waiting to run
system-test / runSystemTestsLinux (map[name:core port:5076]) (push) Blocked by required conditions
system-test / runSystemTestsLinux (map[name:v1Migration port:5077]) (push) Blocked by required conditions
system-test / runSystemTestsWindows (push) Blocked by required conditions

Closes #1040
This commit is contained in:
TheOtherP 2026-01-30 14:55:29 +01:00
parent 440d337415
commit d72623435a
3 changed files with 11 additions and 2 deletions

View File

@ -13,7 +13,10 @@
"Bash(mvn test:*)",
"Bash(mvn help:describe:*)",
"mcp__github__get_commit",
"Bash(findstr:*)"
"Bash(findstr:*)",
"Bash(dir \"c:\\\\temp\\\\hydrastats\")",
"Bash(gh issue view:*)",
"Bash(gh api:*)"
],
"deny": [],
"ask": []

View File

@ -97,7 +97,8 @@ public class NotificationHandler {
throw new RuntimeException("Unable to generate notification body", e);
}
notificationRepository.save(new NotificationEntity(event.getEventType(), NotificationMessageType.valueOf(configEntry.getMessageType().name()), notificationTitle, notificationBody, configEntry.getAppriseUrls(), Instant.now()));
final String truncatedBody = notificationBody.length() > 255 ? notificationBody.substring(0, 255) : notificationBody;
notificationRepository.save(new NotificationEntity(event.getEventType(), NotificationMessageType.valueOf(configEntry.getMessageType().name()), notificationTitle, truncatedBody, configEntry.getAppriseUrls(), Instant.now()));
if (notificationConfig.getAppriseType() == NotificationConfig.AppriseType.NONE) {
logger.debug(LoggingMarkers.NOTIFICATIONS, "Apprise type set to None");

View File

@ -1,4 +1,9 @@
#@formatter:off
- version: "v8.3.1"
date: "2026-01-30"
changes:
- type: "fix"
text: "Truncate notification body to 255 characters before saving to database to prevent DataIntegrityViolationException causing massive log files. See #1040"
- version: "v8.3.0"
date: "2026-01-16"
changes: