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:
@@ -99,13 +99,22 @@ async function startCall() {
|
||||
};
|
||||
|
||||
ws.onclose = () => {
|
||||
setStatus('Disconnected');
|
||||
stopCall();
|
||||
if (active) {
|
||||
setStatus('Disconnected — reconnecting...');
|
||||
setTimeout(() => { if (active) { stopCall(); startCall(); } }, 1000);
|
||||
} else {
|
||||
setStatus('Disconnected');
|
||||
}
|
||||
};
|
||||
|
||||
ws.onerror = (e) => {
|
||||
setStatus('Connection error');
|
||||
stopCall();
|
||||
if (active) {
|
||||
setStatus('Connection error — reconnecting...');
|
||||
setTimeout(() => { if (active) { stopCall(); startCall(); } }, 1000);
|
||||
} else {
|
||||
setStatus('Connection error');
|
||||
stopCall();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user