From 9c458ba19f757a8b662afe48632444521089d60c Mon Sep 17 00:00:00 2001 From: Krispire Admin Date: Sat, 29 Aug 2026 18:56:33 +0530 Subject: [PATCH] fix: no attachment broadcast fix --- internal/service/chat_service.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/internal/service/chat_service.go b/internal/service/chat_service.go index f8e0af7..16c68aa 100644 --- a/internal/service/chat_service.go +++ b/internal/service/chat_service.go @@ -1118,6 +1118,14 @@ func (s *ChatService) systemMessage(ctx context.Context, conversationID, body st return } if created { + // Publish the hydrated message. Append leaves Attachments nil, which + // serialises to null and breaks clients that trust the "always an + // array" contract this field's own doc comment promises. + if full, hErr := s.withAttachments(ctx, "", msg); hErr == nil { + msg = full + } else if msg.Attachments == nil { + msg.Attachments = []model.Attachment{} + } s.publish(ctx, conversationID, "", msg) } }