Refuse failed attachments in messages through a zone port

The messaging zone asks a new AttachmentStates port whether any listed
attachment of the chat has failed and answers 409 conflict before the
message is stored; queued and processing attachments can still be
sent right after the upload. The check runs only on the first execution
of a key, so a replay returns the original 201 even if the attachment
failed later. main.py wires the port to the attachments directory, so
neither zone reads the other's tables.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Artyom
2026-10-29 01:09:31 +03:00
co-authored by Claude Opus 5.5
parent b152b6e07e
commit 34741dc2d2
8 changed files with 95 additions and 12 deletions
@@ -27,9 +27,9 @@
## 5. Связь зон
- [ ] 5.1 `messaging`: порт `AttachmentStates`, ошибка `AttachmentUnavailable` → `409`, проверка только для первого исполнения (повтор по ключу возвращает исходный ответ)
- [ ] 5.2 `main.py`: адаптер порта поверх `AttachmentDirectory`, версия 1.5.0
- [ ] 5.3 Проверка группы: API-тесты — `202 queued`, `409` на `/content` до `ready`, `400` на неизвестный `variant`, `404` на `crop`, сообщение с `queued` — `201`, с `failed` — `409`
- [x] 5.1 `messaging`: порт `AttachmentStates`, ошибка `AttachmentUnavailable` → `409`, проверка только для первого исполнения (повтор по ключу возвращает исходный ответ)
- [x] 5.2 `main.py`: адаптер порта поверх `AttachmentDirectory`, версия 1.5.0
- [x] 5.3 Проверка группы: API-тесты — `202 queued`, `409` на `/content` до `ready`, `400` на неизвестный `variant`, `404` на `crop`, сообщение с `queued` — `201`, с `failed` — `409`
## 6. Стенд