Her socket looks alive. It's been dead for minutes.
transcript
Priya steps into a lift. Her signal drops. The server still thinks she's connected. The registry points at a dead socket. Every push to her just vanishes.
Here's why. An idle TCP connection sends nothing. So neither end knows it's dead. Until it sends.
TCP keepalive? Linux waits 2 hours by default. The NAT standard says mappings last at least 2 hours 4 minutes. Reality? One carrier cut idle connections at 255 seconds. Your own load balancer gives up at 60.
A teammate saves battery. Heartbeat every 5 minutes. The carrier forgets the connection first. Pushes vanish. Users say: notifications only show up when I reopen the app. Instead, beat every 25 to 30 seconds. With jitter, so phones don't all beat together.
Server hears nothing for 75 seconds? Close it. Client misses one pong? Reconnect. Then resume from the inbox. Nothing lost.
Your heartbeat must beat the shortest timeout on the path. Usually your own load balancer. Then the worst carrier.
Full breakdown in the lecture.