← All writing
Engineering·Aug 22, 2026·6 min read

What real-time features don't show you in a demo

A synced cursor and a typing indicator look effortless in the pitch. Reconnection, out-of-order updates, and duplicate events are what actually consume the build.

H

Hammad Iqbal

Software Engineer

Socket.io makes 'it updates live' look like a small feature. The demo is one browser tab talking to another on the same Wi-Fi. Production is a laptop that sleeps mid-drag, a phone that drops to 3G in an elevator, and two people editing the same board at the same time.

In brief
  • The open connection is the easy part — the reconnect-and-resync logic is the actual feature.
  • Out-of-order events break state faster than dropped ones do.
  • Every real-time feature needs a visible 'reconnecting' state in the UI, not just a spinner.

Reconnection is where the design doc goes quiet

Building a drag-and-drop board with a live sync layer, the socket handshake was never the hard part — it was what to do with a client that reconnects after thirty seconds with no idea what changed while it was gone. Replaying the missed events isn't enough if the client doesn't know how many it missed, so the client needs a cheap way to ask 'am I current?' and fall back to a full snapshot when it isn't.

Ordering matters more than delivery

A socket connection doesn't guarantee that events arrive in the order they actually happened, especially once retries and reconnects are involved. Trusting 'last message wins' quietly corrupts state the first time a stale event arrives after a newer one. The fix is boring: attach a version or timestamp to every mutation and let the client discard anything older than what it already has.

  • Attach a version or timestamp to every mutation, not just the payload
  • Reject or discard stale events instead of blindly applying them
  • Reconcile with a full fetch periodically, not only on reconnect

The typing indicator needs a design for 'stale'

Presence — who's online, who's typing — rots the moment a tab closes without firing a clean disconnect event, which happens constantly on mobile. A heartbeat with a timeout, rather than trusting the disconnect event to always fire, is what keeps 'Sarah is typing...' from staring back at you five minutes after Sarah closed her laptop.

Takeaway

Budget real-time features for the reconnect path, not the happy path — that's the 20% that actually takes the time.

Have a project this kind of thinking applies to?

Tell me what you're building — I read every message myself.

Available for new projects

4+

Years exp.

8+

Projects shipped

<6h

Avg. reply time

Let's build something

Tell me about your project.

Share what you're building, your timeline, and the best way to reach you.