Files
Nexus/docs/audit/2026-06-07-settings-telegram-fix.md
T
Nexus Agent 540a7fce05 fix(settings): Telegram 检测/测试闭环与 8 项告警开关恢复
检测与测试前自动持久化 Token/Chat ID;getUpdates 清除 Webhook 并返回具体 API 错误;恢复 NOTIFY 分项开关与免密 reveal。
2026-06-07 19:45:07 +08:00

38 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 审计 — 设置页 Telegram 全流程修复
## 范围
| 文件 | 变更 |
|------|------|
| `frontend/src/pages/SettingsPage.vue` | persist/save/test/detect、8 NOTIFY 开关、reveal 免密 |
| `frontend/src/types/api.ts` | `NOTIFY_TOGGLE_ITEMS` |
| `server/api/settings.py` | Webhook 清除、错误详情、reveal 免密 |
| `tests/test_settings_telegram.py` | 6 用例 |
| `deploy/gate_log.jsonl` | 门控记录(自动生成) |
## Step 3 规则扫描
| H | 规则 | 结论 |
|---|------|------|
| H1 | 测试/检测前持久化 Token+Chat ID | FIXED — `persistTelegramConfig` |
| H2 | getUpdates Webhook 冲突 | FIXED — `deleteWebhook` before poll |
| H3 | Telegram API 错误可见 | FIXED — `ok:false` / sendMessage description |
| H4 | 8 项 NOTIFY 开关 UI | FIXED — Vue v-switch + PUT |
| H5 | reveal 免密(用户确认) | FIXED — JWT + 审计保留 |
## Closure
| H | 判定 | 依据 |
|---|------|------|
| H1H5 | FIXED | 代码 + pytest 6/6 |
## DoD
- [x] pytest `test_settings_telegram.py` 6 passed
- [x] changelog / audit
- [x] 无不可变 key 变更
## 验证
`.venv/bin/pytest tests/test_settings_telegram.py -q`