Skip to content

webui: close the signaling WebSocket when a session ends - #46

Merged
Rust-KVM merged 1 commit into
devfrom
claude/webui-reconnect-leak
Oct 11, 2026
Merged

Rust-KVM merged 1 commit into
devfrom
claude/webui-reconnect-leak

Conversation

@Rust-KVM

Copy link
Copy Markdown
Owner

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

Peer now holds the outbound signaling sender. Peer::close() and the two failure paths in connect() close that channel (and the peer connection); the sender task then exits its loop and calls sink.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)
  • Frontend touched: trunk build --locked and wasm32 clippy in crates/rkvm-web (CI)
  • Tested on an RK3588 device: a build merging all five round-2 branches was deployed to the NanoPC-T6; / returns 200, unknown paths 404, 4K60 video plays, startup log has no WARN/ERROR.

Checklist

  • No #[allow(...)] suppressions and no new unwrap() / expect() in production paths
  • Hot paths stay zero-copy; periodic loops use MissedTickBehavior::Delay
  • Shared protocol types live in rkvm-proto
  • RPC method set changed → not applicable
  • Module tree or build invariants changed → not applicable

Round 2 of the web UI retest fixes (minor issues). The five round-2 branches merge onto dev together without conflicts.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PbdzY6PfT28goR4BhqdsXR


Generated by Claude Code

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>
@github-actions github-actions Bot added the rkvm-web Leptos / WASM frontend label Oct 11, 2026
@Rust-KVM Rust-KVM self-assigned this Oct 11, 2026
@Rust-KVM
Rust-KVM merged commit 42e6833 into dev Oct 11, 2026
13 checks passed
@Rust-KVM Rust-KVM mentioned this pull request Oct 11, 2026
10 tasks done
@Rust-KVM
Rust-KVM deleted the claude/webui-reconnect-leak branch October 12, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rkvm-web Leptos / WASM frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants