fix: no attachment broadcast fix
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user