mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-10-27 07:56:48 +09:00
* Check a cable connection's session while it's open Signing out or changing the password ends sessions and then disconnects their connections. A connection that found its session just before isn't subscribed to its disconnects yet, so it missed that and stayed open. Each connection now looks its session up every minute while it's open, and closes once the session is gone, asking the browser to reconnect so one holding a current session comes back. That also covers any other way a connection misses the disconnect, such as a subscription that takes long to register, and a lookup that fails is simply tried again. * Check the session on the server's heartbeat rather than a timer of its own A connection's own timer could outlive it: closing can run before opening finishes, or a channel's teardown can fail before the connection's. The heartbeat only reaches connections that are open, so nothing is left to stop. * Skip the session check on a rejected connection A rejected connection stays registered until its socket closes, and has no session to check, so its heartbeat mustn't fail and stop the heartbeat reaching the connections after it.