fix(desktop): restore windows daemon bootstrap logging

This commit is contained in:
Mohamed Boudra
2026-03-28 00:25:23 +07:00
parent 394b9cac13
commit 7bc1f04e27
2 changed files with 27 additions and 12 deletions
+26 -11
View File
@@ -1162,19 +1162,34 @@ export class HostRuntimeStore {
}
private async bootstrapDesktop(): Promise<void> {
try {
const daemon = await startDesktopDaemon();
const connection = connectionFromListen(daemon.listen);
if (!connection || !daemon.serverId) {
let lastError: unknown = null;
for (let attempt = 1; attempt <= 3; attempt += 1) {
try {
const daemon = await startDesktopDaemon();
const connection = connectionFromListen(daemon.listen);
if (!connection || !daemon.serverId) {
return;
}
await this.upsertHostConnection({
serverId: daemon.serverId,
label: daemon.hostname ?? undefined,
connection,
});
return;
} catch (error) {
lastError = error;
console.warn(`[HostRuntime] Failed to bootstrap desktop daemon (attempt ${attempt}/3)`, error);
if (attempt < 3) {
await new Promise((resolve) => {
setTimeout(resolve, attempt * 500);
});
}
}
await this.upsertHostConnection({
serverId: daemon.serverId,
label: daemon.hostname ?? undefined,
connection,
});
} catch (error) {
console.warn("[HostRuntime] Failed to bootstrap desktop daemon", error);
}
if (lastError) {
console.warn("[HostRuntime] Desktop daemon bootstrap exhausted retries", lastError);
}
}
+1 -1
View File
@@ -1,5 +1,5 @@
import log from "electron-log/main";
log.initialize();
log.initialize({ spyRendererConsole: true });
import path from "node:path";
import { pathToFileURL } from "node:url";