Реализовать общую идемпотентность отправки сообщения

Ключ Idempotency-Key с TTL (минимум 86400 c), таблица message_requests и
advisory-лок на (пользователь, чат, ключ): конкурентные повторные запросы
возвращают одно и то же сообщение, конфликт по body -> 409. Добавлена
миграция 002 и сценарий проверки scripts/check_idempotency.py.
This commit is contained in:
2026-11-16 22:18:42 +00:00
parent 9698fae3be
commit 0e20efe781
7 changed files with 91 additions and 8 deletions
+1 -1
View File
@@ -13,5 +13,5 @@ class Repository(Protocol):
def create_chat(self, actor, title, members): ...
def chat(self, actor, chat_id): ...
def chats(self, actor, limit, after): ...
def create_message(self, actor, chat_id, text): ...
def create_message(self, actor, chat_id, text, key, ttl): ...
def messages(self, actor, chat_id, limit, after): ...