Files
pipelines/internal/server/chat_reply_paragraphs_test.go
T
alan fc7dbb0ac0 Remove ntfy: notifications go only through the app notification stream
Server: drop ntfy publishing (stage hooks, run outbox, chat attention, chat
tool notify, auto-switch and schedule notices), the chat push outbox (its
table is dropped at startup), ntfy status/endpoints and PIPELINES_NTFY_*.
The app_notifications stream, subscribe/clear and kinds are unchanged.
Notification settings keep run_finished/chat_needs_you/chat_reply_finished;
ntfy_enabled is accepted and ignored and its stored row is never read.

Stage type=ntfy is rejected: "ntfy stages were removed; notifications go to
the Pipelines apps — use the stage notify hook". The notify hook remains.

Installer: no ntfy build, accounts, config or supervisor child; manifest
gets top-level "mode" (legacy ntfy.mode still read). Reinstall retires an
old ntfy (safe PID-file stop, deletes binary, config, data dir, token, log,
with a note in logs/install.log); uninstall cleans leftovers.

App: ntfy settings section replaced by "Notification events"; texts updated.
Docs: docs/ntfy.md folded into docs/notifications.md; install, docker, cli,
author skill references updated; security review M1 marked resolved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 23:24:24 +00:00

23 lines
723 B
Go

package server
import (
"strings"
"testing"
"unicode/utf8"
)
func TestReplyNotificationKeepsParagraphs(t *testing.T) {
got := paragraphs(" First line \r\n\r\n\n\n Second paragraph \nthird\x00 line\n\n")
if want := "First line\n\nSecond paragraph\nthird line"; got != want {
t.Fatalf("paragraphs = %q, want %q", got, want)
}
_, body := chatReplyText("Chat", "One\n\nTwo")
if body != "One\n\nTwo" {
t.Fatalf("app body should keep paragraph breaks, got %q", body)
}
long := truncateRunes(strings.Repeat("a", 1500), chatReplyBodyRunes)
if n := utf8.RuneCountInString(long); n != chatReplyBodyRunes+1 || chatReplyBodyRunes != 1000 {
t.Fatalf("excerpt is %d runes (limit %d)", n, chatReplyBodyRunes)
}
}