fix(fifo): ContentBasedDeduplication + dedup window survives delete (AWS semantics)

- ContentBasedDeduplication=true: dedupId computed from body SHA-256 when not provided
- do NOT drop dedupId on message delete: AWS keeps the 5-minute window regardless
  (previously re-send after delete delivered the message again)
- utils: GetSHA256Hash
This commit is contained in:
Repinoid
2026-10-10 17:30:02 +03:00
parent 9f1242aca3
commit ccd070200a
5 changed files with 30 additions and 7 deletions
+3 -1
View File
@@ -56,7 +56,9 @@ func DeleteMessageV1(req *http.Request) (int, interfaces.AbstractResponseBody) {
queue.ClearInFlight(i, receiptHandle)
queue.UnlockGroup(msg.GroupID)
queue.RemoveIndex(i) // tombstone за O(1) + подрезка хвоста/амортизированная компакция
delete(queue.Duplicates, msg.DeduplicationID)
// ВАЖНО: запись в Duplicates НЕ удаляем — AWS держит dedup-окно 5 минут
// независимо от удаления сообщения (иначе повторный send с тем же
// dedupId доставлялся бы повторно). Чистит только истечение окна (PeriodicTasks).
// Удаляем одно сообщение из Redis — O(1)
persistence.DeleteMessagePersist(key, msg.Uuid)
// Метаданные очереди (duplicates, FIFO state)