fix: race condition hardening across auth, counters, and data fetching #102
Reference in New Issue
Block a user
Delete Branch "fix/race-conditions-critical"
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?
Summary
UPDATE...WHERE revoked_at IS NULLto prevent concurrent replays. All single-use tokens (invite codes, password reset, email verification) useSELECT FOR UPDATEto prevent double-spend.usage_countand tagusage_countincrements/decrements use SQL-level expressions instead of Python read-modify-write, preventing lost updates under concurrent load.db.flush()to close the race window where two concurrent creates both pass the pre-check.handleSaveDraftandhandlePublishnow checkisSavinginside the handler, not just on the buttondisabledprop — prevents Ctrl+S from firing duplicate saves.Test plan
🤖 Generated with Claude Code
🚅 Deployed to the patherly-pr-102 environment in selfless-grace