bug: Active game session desync, badge template resolution, and XP race conditions

未关闭
#2,652 3 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

  • #2653 来自 @rajatsurana19 —— 已关闭,未合并

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
cpp, django, python

调研方向

The report names generate_badge, award_xp, update_opening_progress, and the game state views, but gives no file paths or test names. Start by locating those entry points and reading the linked closed pull request #2653 to see the status of the proposed fixes. Done means each of the five reported failures has a regression test and the affected behavior passes.

由索引模型根据 Issue 内容生成。

描述

bug GSSoC
Describe the Bug

During codebase security and testing analysis, multiple issues were confirmed:

  1. Active game state desync: For authenticated users, views (valid_moves, check_promotion, get_state, offer_draw) only query session['game'], returning empty legal moves and broken draw offers.
  2. Badge download crash: generate_badge uses an incorrect template directory path, resulting in FileNotFoundError on badge downloads.
  3. Progression race condition: award_xp updates XP without atomic transaction and row locking, causing lost progress under concurrent requests.
  4. Type error in opening trainer: update_opening_progress returns None instead of a tuple when user is None.
  5. Email sender fallback: Hardcoded EMAIL_HOST_USER causes failure in environments where only DEFAULT_FROM_EMAIL is set.
Steps to Reproduce
  1. Log in as an authenticated user, make a move, and call /api/valid-moves/ (returns empty moves).
  2. Unlock an achievement and call /achievement//download/ (raises FileNotFoundError).
Proposed Solution

I have already developed and verified minimal fixes with full test coverage on my fork, passing all 351 Django and Selenium tests, Flake8, and Bandit SAST.

I would like to work on this. Please assign this issue to me (@rajatsurana19) so I can submit the Pull Request.

主要语言
Python
星标
140
派生
513
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Checkora/Checkora 的其他 Issue

查看 Checkora/Checkora 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。