Engineering2026-05-23

New post

P

Paccy

Co-Founder · Engineering

10 min read

Reading time

Hiddit

Project context

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.

typescript
  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)

P

Paccy

Engineer at ASYNCC. Shipping software that works in the real world, not just in dev.

Next post

The race condition that kept us up for three nights — and what we learned from it(updated)

Read it ►