Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix] [#431] Some disconnected user-ids not removed from `connected-u…
…ids` Big thanks to @krajj7 for the report and huge assistance debugging! As part of the investigation into this issue, and due to another recent related issue (#429), I decided that we were overdue for a refactor of Sente's connection management system. The old system had grown overly complex, and left too much room for edge cases and timing issues. This commit introduces a major refactor of the system, with an emphasis on robustness and improved observability. Specific improvements include: - New internal "conn-id" concept that: 1. No longer depends on http server implementations to properly implement identity 2. Greatly improves logging output, easing debugging - General logging improvements to ease debugging - Now expose internal `conns_` state to ease debugging - Added server-side ping timeout to match client side, and to catch unexpected cases where http server is never able to identify a connection as broken. Note that this new feature is currently opt-in[1], but will be enabled by default in a future release. - Simplified internal API for updating `conns_` state. - More robust handling when events fire in unexpected order (e.g. :on-close firing before :on-open handshake). - Generally improved clarity and robustness. Note: some related additions will also be made to the reference example project in another commit. [1] Provide a value (e.g. 5000) for the new `:ws-ping-timeout-ms` option to `make-channel-socket-server!`
- Loading branch information