60085c1d72
A phone changing cell or locking its screen drops the push stream for a few seconds while its audio keeps playing. The server released session ownership the instant that stream closed, and the phone read its own reconnect snapshot as another device taking over: it paused, and rewound to whatever position it had last reported. Ownership now survives a closed stream. A device that is really gone still loses the session, via pagehide and via the sweep that frees an owner whose heartbeat stopped. The client no longer treats an unowned session as an instruction to stop. With audio loaded it claims the session back instead. Two ways a phone could go quiet until the page was reloaded are also gone: registration is retried rather than attempted once, and the push stream reopens after an error status, which EventSource treats as final. It also checks itself when the network or the tab comes back. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KENqSChfyqWnor6ud2WWH6