Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix(upgradeFallback): enforce destruction deadline after socket.end

Adam Eivy6cd2802b95a3
diff --git a/server/lib/upgradeFallback.js b/server/lib/upgradeFallback.js
index bce2d38956..876c6a4334 100644
--- a/server/lib/upgradeFallback.js
+++ b/server/lib/upgradeFallback.js
@@ -70,6 +70,12 @@ export function installUpgradeFallback(server, { timeoutMs = DEFAULT_UPGRADE_TIM
if (socket.bytesWritten > 0) return;
socket.on('error', () => {});
socket.end();
+ const destroyTimer = setTimeout(() => {
+ if (!socket.destroyed) {
+ socket.destroy();
+ }
+ }, 100);
+ destroyTimer.unref?.();
}, timeoutMs);
timer.unref?.();