Repository navigation
webui: close the signaling WebSocket when a session ends - #46
Merged
Merged
Conversation
The signaling socket's sender task waited on a queue whose senders (ping loop, ICE candidate callback) never went away, so the socket outlived its session: every reconnect, and every failed connect, left one more signaling connection open on the device. Keep the queue's sender in Peer and close it in Peer::close and on connect failure; the sender task then exits and closes the socket, and the ping loop stops once its sends fail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
10 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by 4c · project thread
Summary
Before: the signaling WebSocket stayed open after a session ended or a connection attempt failed, so every Reconnect left one more idle signaling connection on the device.
After: ending a session, a failed ICE connection, or a data-channel timeout all close the signaling socket, so reconnecting no longer leaks connections.
How
Peernow holds the outbound signaling sender.Peer::close()and the two failure paths inconnect()close that channel (and the peer connection); the sender task then exits its loop and callssink.close()on the WebSocket.Testing
cargo +nightly fmt --all(CI)cargo +nightly clippy --workspace --release --all-targets -- -D warnings(CI)cargo +nightly test --workspace(CI)trunk build --lockedand wasm32 clippy incrates/rkvm-web(CI)/returns 200, unknown paths 404, 4K60 video plays, startup log has no WARN/ERROR.Checklist
#[allow(...)]suppressions and no newunwrap()/expect()in production pathsMissedTickBehavior::Delayrkvm-protoRound 2 of the web UI retest fixes (minor issues). The five round-2 branches merge onto
devtogether without conflicts.🤖 Generated with Claude Code
https://claude.ai/code/session_01PbdzY6PfT28goR4BhqdsXR
Generated by Claude Code