Files
awoooi/apps/api
Your Name 3e382a4225 fix(telegram): P0 async race + P1 short_id 碰撞 + P0 incident_id 修復
- _build_llm_action_buttons 改 async,await setex 在 return 前完成
  (消除「按鈕發出→點擊→Redis 未寫完」的 race)
- short_id 從 4 bytes → 8 bytes(16-hex),64-bit 碰撞空間
- payload 加入 incident_id,callback handler 從 payload 還原真實 ID
  (修 P0-2:避免 short_id 進 context 造成 KM 學習鏈錯亂)
- Redis 故障與按鈕過期分流回應(P1)
- HTML escape 防 XSS(P2)
- _build_inline_keyboard 改 async,兩個呼叫端加 await
- tests 全部改 @pytest.mark.asyncio + AsyncMock redis
  (1495 passed in unit suite)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 19:56:51 +08:00
..