Skip to content

fix: LastSeenCoursewareTimezone race condition#593

Merged
eemaanamir merged 1 commit intodevelop-teakfrom
eemaan/fix-course-last-seen
Feb 19, 2026
Merged

fix: LastSeenCoursewareTimezone race condition#593
eemaanamir merged 1 commit intodevelop-teakfrom
eemaan/fix-course-last-seen

Conversation

@eemaanamir
Copy link
Copy Markdown
Collaborator

Original PR: #536

Fix race condition when setting user's last seen courseware timezone
Description
This PR updates the set_last_seen_courseware_timezone method to handle potential race conditions that could occur when multiple concurrent requests attempt to create or update a user’s LastSeenCoursewareTimezone record simultaneously.

Previously, concurrent writes could trigger IntegrityError exceptions when two requests attempted to create the same record at the same time. This PR introduces a try/except block to safely handle that scenario by catching the IntegrityError, then performing an explicit update instead.

Fixes: #533

@eemaanamir eemaanamir merged commit 707ac1b into develop-teak Feb 19, 2026
9 of 12 checks passed
@eemaanamir eemaanamir deleted the eemaan/fix-course-last-seen branch February 19, 2026 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants