feat(v2): refactor reconnection probe to TCP-only and add frontend listeners

Replace attempt_ws_connect() with attempt_tcp_probe() in RemoteManager to
avoid allocating per-connection resources (PtyManager, SidecarManager) on
the relay during reconnection probes. Add onRemoteMachineReconnecting and
onRemoteMachineReconnectReady event listeners in remote-bridge.ts. Wire
machines store to auto-reconnect when relay becomes reachable.
This commit is contained in:
Hibryda 2026-03-06 21:50:45 +01:00
parent 218570ac35
commit 71100da125
3 changed files with 59 additions and 23 deletions

View file

@ -120,3 +120,24 @@ export async function onRemoteError(
callback(event.payload);
});
}
export interface RemoteReconnectingEvent {
machineId: string;
backoffSecs: number;
}
export async function onRemoteMachineReconnecting(
callback: (msg: RemoteReconnectingEvent) => void,
): Promise<UnlistenFn> {
return listen<RemoteReconnectingEvent>('remote-machine-reconnecting', (event) => {
callback(event.payload);
});
}
export async function onRemoteMachineReconnectReady(
callback: (msg: RemoteMachineEvent) => void,
): Promise<UnlistenFn> {
return listen<RemoteMachineEvent>('remote-machine-reconnect-ready', (event) => {
callback(event.payload);
});
}