From 1a20903b3eb7e2e4b8488582a248c63d981343c3 Mon Sep 17 00:00:00 2001 From: Merlin <158784988+merlinz01@users.noreply.github.com> Date: Fri, 19 Sep 2025 15:25:59 -0400 Subject: [PATCH 1/2] Limit Zulip subject length and add URL topic override Subjects over 60 characters long, such as the test notification, are rejected by shoutrrr. This truncates the subject to the max length. Users may want all Scrutiny notifications to be sent to a particular topic rather than whatever Scrutiny happens to decide. --- webapp/backend/pkg/notify/notify.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/webapp/backend/pkg/notify/notify.go b/webapp/backend/pkg/notify/notify.go index bf927ee3..277586a9 100644 --- a/webapp/backend/pkg/notify/notify.go +++ b/webapp/backend/pkg/notify/notify.go @@ -424,6 +424,13 @@ func (n *Notify) GenShoutrrrNotificationParams(shoutrrrUrl string) (string, *sho case "telegram": (*params)["title"] = subject case "zulip": + if len(subject) > 60 { + subject = subject[:60] + } + urlTopic := serviceURL.Query()["force_topic"] + if urlTopic != "" { + subject = urlTopic + } (*params)["topic"] = subject } From 4c6c5ee89bd94ff9f7792bf9bef11bd38ce35647 Mon Sep 17 00:00:00 2001 From: Merlin <158784988+merlinz01@users.noreply.github.com> Date: Mon, 20 Oct 2025 09:17:49 -0400 Subject: [PATCH 2/2] Fix usage of URL query value --- webapp/backend/pkg/notify/notify.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webapp/backend/pkg/notify/notify.go b/webapp/backend/pkg/notify/notify.go index 277586a9..2486b58e 100644 --- a/webapp/backend/pkg/notify/notify.go +++ b/webapp/backend/pkg/notify/notify.go @@ -428,8 +428,8 @@ func (n *Notify) GenShoutrrrNotificationParams(shoutrrrUrl string) (string, *sho subject = subject[:60] } urlTopic := serviceURL.Query()["force_topic"] - if urlTopic != "" { - subject = urlTopic + if len(urlTopic) > 0 && urlTopic[len(urlTopic)-1] != "" { + subject = urlTopic[len(urlTopic)-1] } (*params)["topic"] = subject }