Files

34 lines
2.0 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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.

## Why
赛马插件group_horse_racing代码审查发现多个影响稳定性、数据完整性和用户体验的问题需集中修复以提升生产可靠性。
## What Changes
### P0 - 严重
1. **SQLite 阻塞事件循环** (
oom_store.py):每次操作同步连接 SQLite在 async 上下文中阻塞 NoneBot 事件循环,高并发时可能卡死。
2. **积分重试逻辑无意义** (points_service.py:17-20)spend_points 失败后立即重试无延时,余额不足时重试毫无意义,网络失败也无间隔。
3. **消息发送静默吞异常** (commands.py:271-272)_send_to_scope 中 except Exception: pass比赛进度发送失败完全无人知晓。
### P1 - 中等
4. **赔率快照时机** (commands.py:492-493):下注时显示的赔率与结算时赔率可能不一致(其他用户同时下注导致动态变化),用户预期不符。
5. **race_history 缺失积分变化** (
oom_store.py:148-161)save_race_result 未存入 point_changes 和 point_change_summaries历史查询无法追溯积分变化。
6. **测试命令侵入生产数据** ( est_commands.py:5):直接导入生产
oom_store 实例,测试误操作会污染真实数据。
### P2 - 低
7. **马名大小写去重漏洞** (commands.py)_find_duplicate_horse 用 casefold() 但 dict key 是原始大小写,可能注册出仅大小写不同的同名马。
## Capabilities
### Modified Capabilities
- horse-race-betting: 修复积分重试逻辑、赔率快照一致性
- horse-race-room-flow: 修复 SQLite 阻塞、异常静默吞没
- horse-race-test-mode: 修复测试数据隔离
- horse-race-history: 补存积分变化到 race_history
## Impact
- **修改文件**: points_service.py,
oom_store.py, commands.py, est_commands.py
- **新增依赖**: iosqlite替代同步 sqlite3
- **数据影响**: race_history 表新增字段,现有数据无需迁移(新旧数据兼容)
- **现有系统影响**: 不改变插件对外接口,仅内部修复