Drobysh 2b08a4999f 🌊 Волна 19: backend — 6 фиксов + database.py
database.py:
- get_pool_race: asyncio.Lock + двойная проверка
- init_db_no_transaction: вся инициализация в одной транзакции
- drop_constraint_cascade: убран CASCADE
- add_pk_on_duplicates: DELETE дублей через DISTINCT ON (умная версия)
- redundant_index_users_telegram: удалены дубли индексов
- fstring_sql_migration: whitelist regex _SAFE_NAME + _SAFE_TYPE
- ensure_achievements_code_key: гарантия UNIQUE на achievements.code
- sentence_hints_used + typing_hints_used
- client_controlled_* (current_streak, current_mistakes, current_hints_used)

routers/hints.py:
- hint_consumed_before_word_paths_check: инкремент после проверок
- word_list_hint_consumed_on_empty: слова до инкремента

routers/admin_content.py:
- admin_content_text_levels_n_plus_1: 12 запросов → 1 GROUP BY

routers/assistant.py:
- assistant_admin_stats_n_plus_1: 10 запросов → 2 GROUP BY

routers/leaderboard.py:
- leaderboard_admin_stats_n_plus_1: 6 запросов → 1 GROUP BY

routers/achievements.py:
- init_achievements_n_plus_1: 104 запроса → 1 bulk upsert
- добавлен logger (отсутствовал)

Аудит v6: backend 6/6 закрыто
2026-09-25 10:10:11 +00:00
2026-09-20 11:45:58 +00:00
2026-09-20 11:45:58 +00:00
2026-09-20 11:45:58 +00:00
2026-09-20 11:45:58 +00:00
2026-09-20 11:45:58 +00:00
2026-09-20 11:45:58 +00:00
2026-09-20 11:45:58 +00:00
2026-09-20 11:45:58 +00:00
2026-09-20 11:45:58 +00:00
2026-09-20 11:45:58 +00:00
2026-09-20 11:45:58 +00:00
2026-09-20 11:45:58 +00:00
2026-09-20 11:45:58 +00:00
2026-09-20 11:45:58 +00:00
2026-09-20 11:45:58 +00:00
2026-09-20 11:45:58 +00:00
S
Description
No description provided
2 MiB
Languages
Python 100%