feat(新手引导): 支持十圈进度与逐圈发奖 #200
Reference in New Issue
Block a user
Delete Branch "fix-newUserGuildVideoFix0729"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
🤖 review-pr 深审结论
🔴 建议改后再合(置信度 0.88)— 功能逻辑与迁移都验证通过,但打破了 guide_video 全部测试,且夹带无关改动。
实跑(worktree 合并最新 main)
alembic upgrade head(sqlite) 全链跑通;新列(seq/started_at 改 nullable、duration_ms/config_version/settled_circles/prepared_at/expires_at、status 16→24)与两索引(ux_coin_transaction_guide_video_ref/ix_guide_video_play_expires_at)全部落地;down_revision唯一接guide_video_scene_unique,不分叉。reward_coin//10、合计满额、重放幂等already_granted、max_plays后play_limit_reached。autoflush=False+populate_existing=True会在同事务多次发奖时丢余额(inactivity 先 grant_coins 再 grant_cash)。实跑复现推翻:真实grant_coins(-100)+grant_cash(-50)最终 coin/cash 均正确清零;全量测试对比 base 无新增失败。问题
tests/test_guide_video.py6 用例 1 failed + 5 error。根因:改了客户端 API 契约(start 需play_token、reward 改circle、set_video需analysis=)与 repository 签名,但完全没更新测试文件,fixtureset_video()少analysis=直接抛ValueError。新 prepare/start/reward 流程零自动化覆盖。请补/改测试。app/admin/main.py— 端口注释 8771→8773、CORS dev 源 3001→3002。与「十圈发奖」无关,像本地联调环境泄漏;CORS 去掉localhost:3001可能打断其他同事的 admin 前端。建议拆出或还原。FFPROBE_BINARY运行期依赖;迁移_backfill_configs会对存量引导视频重新 ffprobe 并套新约束(30–180s、h264/hevc、aac)。存量若不满足(时长不符/服务器无 ffprobe)→analysis_status=invalid、enabled=False,功能静默关闭需重传。上线前请先装 ffprobe 并知悉存量可能被禁用。正面:upload 临时文件原子发布(
os.replace)+失败清理、cleanup_old_videos保护期设计合理。低危:prepared行(seq=NULL)无回收、崩溃残留.upload临时片。只读深审 · worktree 合并最新 main · 已实跑(迁移+功能+钱包并发)