CONC001warningPro
check-then-act
Check-then-act pattern may cause race condition
Applies to: Go, JavaScript, Python, Ruby, Rust, TypeScript
Why this matters
Between checking if a record exists and creating a new one, another concurrent request could create the same record. This leads to duplicate data, constraint violations, or inconsistent state. Use database transactions with SELECT FOR UPDATE, unique constraints, or atomic upsert operations.
Catch it before it ships
pip install stablestack # or: npx stablestackstablestack # scans your project, CONC001 includedstablestack explain CONC001CONC001 is part of the Pro rule set. See pricing — the free tier ships 24 checks with no signup.
False positive in your codebase? Suppress a single line with # noqa: CONC001