forked from mtusi2026/mtusi2026lab5
chore(lab5): remove stale templates and refresh source comments
This commit is contained in:
@@ -78,7 +78,7 @@ func (s *Store) CreateMessage(ctx context.Context, chatID, senderID uuid.UUID, t
|
||||
return model.Message{}, dbError(scanErr)
|
||||
}
|
||||
found++
|
||||
// Lab5: a queued/processing attachment is already linked to its
|
||||
// A queued/processing attachment is already linked to its
|
||||
// chat and may be sent. Only a terminal failed one is refused.
|
||||
if status == "failed" {
|
||||
rows.Close()
|
||||
@@ -159,9 +159,9 @@ func canonicalAttachmentIDs(ids []uuid.UUID) []uuid.UUID {
|
||||
return result
|
||||
}
|
||||
|
||||
// messageFingerprint keeps the lab3 hash for messages without attachments, so
|
||||
// an idempotency key stored before this migration still replays correctly. For
|
||||
// messages with attachments the sorted IDs are part of the canonical body.
|
||||
// messageFingerprint keeps the legacy hash for messages without attachments,
|
||||
// so an idempotency key stored before this migration still replays correctly.
|
||||
// For messages with attachments the sorted IDs are part of the canonical body.
|
||||
func messageFingerprint(text string, attachmentIDs []uuid.UUID) []byte {
|
||||
if len(attachmentIDs) == 0 {
|
||||
sum := sha256.Sum256([]byte(text))
|
||||
|
||||
Reference in New Issue
Block a user