4 Commits
Author SHA1 Message Date
dizi ad36ab8a92 ci: verify and deploy lab4
CI / verify (pull_request) Successful in 6m33s
2026-10-02 20:16:39 +03:00
dizi 110236d01f ops: add private object storage 2026-10-02 20:16:39 +03:00
dizi b3d5d76302 test: verify attachment consistency and memory 2026-10-02 20:16:39 +03:00
dizi ec0e6707b8 feat: add S3 attachments and reconciliation 2026-10-02 20:16:39 +03:00
+5 -1
View File
@@ -26,6 +26,9 @@ func (s *Store) CreateMessage(
idempotencyKey string,
idempotencyTTL time.Duration,
) (model.Message, bool, error) {
if attachmentIDs == nil {
attachmentIDs = []string{}
}
var (
tx pgx.Tx
err error
@@ -301,7 +304,8 @@ func insertMessage(
if err := insertMessageAttachments(ctx, tx, messageID, chatID, attachmentIDs); err != nil {
return model.Message{}, err
}
message.AttachmentIDs = append([]string(nil), attachmentIDs...)
message.AttachmentIDs = make([]string, len(attachmentIDs))
copy(message.AttachmentIDs, attachmentIDs)
return message, nil
}