Skip to catalogue

44

race condition

The later request finishes first. Search, double-submit, and “check then set” all hit this.

What is race condition?

A race is when correctness depends on lucky timing. Two handlers interleave. The stale search result paints over the fresh one. Two tabs both think they reserved the last seat.

Why does race condition matter when vibe coding?

Models write happy-path async. They do not cancel in-flight fetches. They check-then-insert without a unique constraint. You only see it in production.

How do you do race condition?

Cancel stale requests. Unique constraints in the database, not in if-statements. For bookings, one serialisable transaction or a single row lock, not a read plus a hope.

How do you ask a model for race condition?

Fix races in (feature). Cancel in-flight requests so only the latest result paints. Enforce uniqueness in the database, not in application ifs.

What goes wrong with race condition?

A loading spinner as the fix. Spinners do not serialise writes.

adjacent