From 87b49060222bc30f91149c3971bef3550b081d3a Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Thu, 9 Jul 2026 19:29:01 -0400 Subject: [PATCH] quick ci fix --- .../Services/Innertube/NodesParser.bs | 3 +++ tools/run-test-app.js | 23 +++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/playlet-lib/src/components/Services/Innertube/NodesParser.bs b/playlet-lib/src/components/Services/Innertube/NodesParser.bs index 7cbae7eb..c1752c96 100644 --- a/playlet-lib/src/components/Services/Innertube/NodesParser.bs +++ b/playlet-lib/src/components/Services/Innertube/NodesParser.bs @@ -31,6 +31,7 @@ namespace Innertube throw "Unknown node: " + key #end if #end if + ' bs:disable-next-line LINT2001 continue for end if @@ -1103,6 +1104,7 @@ namespace Innertube throw "Unknown content type: " + contentType #end if #end if + ' bs:disable-next-line LINT2001 return invalid end function @@ -1520,6 +1522,7 @@ namespace Innertube throw "Unknown content type: " + contentType #end if #end if + ' bs:disable-next-line LINT2001 return invalid end function diff --git a/tools/run-test-app.js b/tools/run-test-app.js index 23c8f71f..fdc26378 100644 --- a/tools/run-test-app.js +++ b/tools/run-test-app.js @@ -115,6 +115,7 @@ function startTelnetClientAsync(host, port, timeoutSeconds = 2) { }; connection.on('close', function () { + connection.telnetClosed = true; console.log('connection closed'); }); @@ -142,19 +143,37 @@ function readFromTelnetUntil(connection, timeoutSeconds = 20, endToken = 'AppExi let data = ''; let timeoutID; + let settled = false; + + function settle(fn, arg) { + if (settled) return; + settled = true; + clearTimeout(timeoutID); + fn(arg); + } function timeoutReached() { - reject(`Timeout of ${timeoutSeconds} seconds waiting for ${endToken}`); + settle(reject, `Timeout of ${timeoutSeconds} seconds waiting for ${endToken}`); connection.end(); } + function connectionClosed() { + settle(reject, `Connection closed before ${endToken}`); + } + + if (connection.telnetClosed) { + connectionClosed(); + return; + } + connection.on('close', connectionClosed); + connection.on('data', (chunk) => { process.stdout.write(chunk.toString()); clearTimeout(timeoutID); data += chunk.toString(); if (withoutQuotedLines(data).includes(endToken)) { - resolve(data); + settle(resolve, data); connection.end(); return; }