check still open

This commit is contained in:
duffyduck 2026-03-29 15:53:11 +02:00
parent ecc3d59a8f
commit 7545c9c823
1 changed files with 6 additions and 3 deletions

View File

@ -509,17 +509,20 @@ function connectRVS(forcePlain) {
}
function sendToRVS(text, isPipeline) {
log("info", "rvs", `sendToRVS: rvsWs=${rvsWs ? 'exists' : 'null'}, readyState=${rvsWs ? rvsWs.readyState : 'N/A'}, OPEN=${WebSocket.OPEN}`);
if (!rvsWs || rvsWs.readyState !== WebSocket.OPEN) {
log("error", "rvs", "Nicht verbunden");
log("error", "rvs", `Nicht verbunden (readyState: ${rvsWs ? rvsWs.readyState : 'null'})`);
if (isPipeline) pipelineEnd(false, "RVS nicht verbunden");
return false;
}
rvsWs.send(JSON.stringify({
const msg = JSON.stringify({
type: "chat",
payload: { text, sender: "diagnostic" },
timestamp: Date.now(),
}));
});
log("info", "rvs", `Sende ${msg.length} bytes an RVS...`);
rvsWs.send(msg);
log("info", "rvs", `Gesendet via RVS: "${text}"`);
if (isPipeline) plog(`Nachricht an RVS gesendet — warte auf Antwort via RVS...`);
return true;