fix: keep VK bot alive across long poll failures

This commit is contained in:
nyan404 committed 2026-10-08 14:09:20 +03:00
1 parent e33de2114a
commit 2d9aa2126c
8 files changed
+157 -15

No files matched your search

+1
View File
@@ -13,6 +13,7 @@
- Confirmed local acceptance: 28 unittest cases pass; local browser smoke generated a 20-minute ЛУ report; `belki-calculator:test` built and its `/health`, `/api/calculate`, `/api/inspect-bulk`, and `/api/resolve-identity` endpoints responded.
- Draft k3s manifests live under `deploy/k8s/` but have not been applied. No VK token, group ID, service IP, or cluster Secret is stored in the repository.
- VK input is now conversational: `BelkiDialog` stores per-peer state, supports `/лу`/`/зу` step-by-step prompts, detects bulk messages, asks for missing skill/status or confirmation, and clears with `/отмена`.
- 2026-10-08: VK Long Poll now catches transient SSL/socket/timeouts, logs and reacquires the Long Poll server instead of terminating `belki-bot`. Unfinished dialog state and queued photos are persisted in `vk_dialog_states` by `VkConversationStore`, so a process restart can resume before confirmation; completed/cancelled states are removed.
- The preferred bulk input is a natural line without pipes, such as `15.08 11:00 11:20 Дикая Вишня 1604614 Серолап 1617140`; `/api/inspect-bulk` and the web form fill recognized fields and show only missing questions.
- `/урок` and `/осмотр` use the same dialog; character name/ID may be entered separately and resolved from the persistent SQLite directory at `BELKI_IDENTITIES_DB` (default `data/belki.sqlite3`), otherwise the dialog asks for the missing half and remembers the completed pair.
- `.gitignore` now excludes Python bytecode/cache and local test/editor artifacts; generated `__pycache__` directories were removed from the working tree.