CONC002warningPro

non-atomic-read-write

Read-then-write pattern without transactional protection

Applies to: JavaScript, Python, TypeScript

Why this matters

Reading a record, checking its status, then writing based on that check is a race condition. Between the read and write, another concurrent request can change the status. Use an atomic update with a WHERE clause that includes the status check, or wrap in a serializable transaction.

Catch it before it ships

pip install stablestack # or: npx stablestackstablestack # scans your project, CONC002 includedstablestack explain CONC002

CONC002 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: CONC002