fix: bridge pairing + auto-reconnect + test stability

Bridge mode rewrite:
- First client echoes while waiting, checks every 100ms if paired
- Second client triggers bridge immediately, first exits echo loop
- After bridge ends, slot is cleared for the next pair
- No more two tasks competing for the same transport recv

Web client auto-reconnect:
- On WebSocket close/error, automatically reconnects after 1s
- Keeps retrying as long as the user hasn't clicked Disconnect

Test fix:
- Install rustls crypto provider in transport config tests
  (fixes race condition when running full workspace tests)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Siavash Sameni
2026-03-27 19:49:27 +04:00
parent 38ae62b542
commit ce6aacb25f
3 changed files with 241 additions and 310 deletions

View File

@@ -139,6 +139,7 @@ mod tests {
#[test]
fn server_config_creates_without_error() {
let _ = rustls::crypto::ring::default_provider().install_default();
let (cfg, cert_der) = server_config();
assert!(!cert_der.is_empty());
// Verify the config was created (no panic)
@@ -147,6 +148,7 @@ mod tests {
#[test]
fn client_config_creates_without_error() {
let _ = rustls::crypto::ring::default_provider().install_default();
let cfg = client_config();
drop(cfg);
}