Skip to content

Fix IntegrityError 1062 race on assignment_grade get-or-create#1063

Merged
ionparticle merged 3 commits intomasterfrom
fix/assignment-grade-1062-pr
Feb 10, 2026
Merged

Fix IntegrityError 1062 race on assignment_grade get-or-create#1063
ionparticle merged 3 commits intomasterfrom
fix/assignment-grade-1062-pr

Conversation

@ubc-tuehoang
Copy link
Contributor

Handle duplicate key (user_id, assignment_id) when concurrent requests both create AssignmentGrade: catch MySQL 1062, rollback, re-fetch existing row, update grade, and commit. Applied to calculate_grade, calculate_group_grade, and calculate_grades.

tuehoang and others added 3 commits February 5, 2026 15:10
Handle duplicate key (user_id, assignment_id) when concurrent requests
both create AssignmentGrade: catch MySQL 1062, rollback, re-fetch
existing row, update grade, and commit. Applied to calculate_grade,
calculate_group_grade, and calculate_grades.
Co-authored-by: Cursor <cursoragent@cursor.com>
… 22-char (no pading) UUID in api/file.py via _file_uuid() (same format as File.uuid).
@ionparticle ionparticle merged commit f750475 into master Feb 10, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants