Programmers
Hiddit is a real-time sports court booking app. Players can see live court availability, pick a slot, and book — all in under 30 seconds. We had built the booking flow with optimistic locking: check availability, create a booking if the slot is free, return confirmation. Simple. Except under concurrent load, 'check then write' doesn't mean what you think it means.
async function handleSubmit(e: React.FormEvent) {
e.preventDefault()
setError("")
setLoading(true)
try {
const data = await apiFetch<{ access_token: string }>("/auth/login", {
method: "POST",
body: JSON.stringify({ password }),
})
setToken(data.access_token)
router.push("/admin/dashboard")
} catch (err) {
setError(err instanceof Error ? err.message : "Invalid password.")
} finally {
setLoading(false)
}
}
“Hiddit is a real-time sports court booking app. Players can see live court availability, pick a slot, and book — all in under 30 seconds. We had built the booking flow with optimistic locking: check availability, create a booking if the slot is free, return confirmation. Simple. Except under concurrent load, 'check then write' doesn't mean what you think it means.(updated)”
Paccy
Engineer at ASYNCC. Shipping software that works in the real world, not just in dev.