Data integrity and migrations
Race on balance or inventory writes
Two simultaneous requests both read the old value and both succeed, so a balance goes negative or an item sells twice.
Termsmigration (a scripted change to the database schema that ships with a release and should be reversible) · staging environment (a copy of production, without customer data, where release candidates are tested) · protected branch (the git branch that cannot be pushed to directly and is the only source of production deploys)
highseverity if found in a releasesources verified 2026-09-21
Why AI-assisted code produces it
Read-then-write is the generated shape; transactions and locks need to be requested. Logic issues were 75% more common in AI-co-authored pull requests.
In the same 470-pull-request sample, cross-site scripting issues were up to 2.74 times more frequent in AI-co-authored pull requests; error-handling gaps were nearly 2 times more common and logic and correctness issues 75% more common.
Source: CodeRabbit, 2025-12-17 · verified 2026-09-21
How we detect it
Fire 20 parallel requests that spend the same balance.
Most associated with
Tools: Cursor, GitHub Copilot, Claude Code, Windsurf, Lovable, Bolt
Checklist items that catch it
Concurrent writes on money and inventory paths are safe
automated Fire 20 parallel requests that spend the same balance or claim the same item.
Exactly the allowed number succeed; the stored balance or stock equals the expected value.
Dots: Starter, Growth, Scale. The item runs on every release for the plans marked.
More in data integrity and migrations
- critical
- critical
- high
- high
Check your codebase for this pattern
The coverage audit lists which catalogue patterns apply to your critical flows. 5 business days, $1,200, credited to a first month.