Реализовать общую идемпотентность отправки сообщения
Ключ Idempotency-Key с TTL (минимум 86400 c), таблица message_requests и advisory-лок на (пользователь, чат, ключ): конкурентные повторные запросы возвращают одно и то же сообщение, конфликт по body -> 409. Добавлена миграция 002 и сценарий проверки scripts/check_idempotency.py.
This commit is contained in:
@@ -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): ...
|
||||
|
||||
Reference in New Issue
Block a user