fix: close remaining race conditions (PR 91 continuation) - #91
Closed
aaxnet wants to merge 1 commit into
Closed
Conversation
- Fix rainbow_role task syntax error and batch update logic - Fix unpunish task: dispatch events before deleting infractions - Fix proposal message deletion after successful send - Fix temp_role/temp_multiplier tasks: use FOR UPDATE with re-fetch - Fix clan leave role removal: remove role before DB delete - Fix valentine cooldown: use DB-backed cooldown instead of in-memory dict - Fix compbuilder V2 component send interaction response order - Fix role request approve/decline for_update typo - Fix temp_multiplier/temp_role locking with FOR UPDATE SKIP LOCKED - Fix voice gateway function call formatting - Add regression tests for race conditions - Run ruff and pytest: all pass
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR continues the race condition fixes from PR #90, addressing additional critical race conditions found during extended audit.
Summary of Fixes
Critical Race Conditions Fixed
Clan Shop Double-Spend (clans/commands/manage/shop.py)
Multiplayer Roulette Balance Lost Update ( asks/multiplayer_roulette.py)
Role Request Approve/Decline (
ole_requests/handlers/approve.py, decline.py)
Compbuilder V2 Component Send (compbuilder/components/modal/choose_image.py)
Valentine Cooldown (�alentine/commands/send.py)
Rainbow Role Batch Update ( asks/rainbow_role.py)
Unpunish Task ( asks/unpunish.py)
Proposal Message Deletion (proposals/events/proposal.py)
Clan Leave Role Removal (clans/commands/leave.py)
Temp Role/Multiplier Tasks ( asks/temp_role.py, emp_multiplier.py)
Role Request Approve/Decline - Fixed or_update typo in cast() call
Valentine Cooldown - Replaced in-memory dict with DB-backed cooldown
Compbuilder V2 Component Send - Fixed interaction response order
Rainbow Role Task - Update DB schedule BEFORE Discord API call
Voice Gateway - Fixed function call formatting for line length
Database Helpers Extended
Regression Tests Added
Verification
uff --select E,W,F src - All checks passed
Remaining Known Issues (Future Work)
ole_requests modal send/create still has minor TOCTOU
Closes #90