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
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix: WebSocket upgrade refusal flake in httpDrain (#8389)
[._.]/ Adam Eivy0cf1634fc7e8
diff --git a/server/lib/httpDrain.js b/server/lib/httpDrain.jsindex ee3c1474d1..5eb85d1381 100644--- a/server/lib/httpDrain.js+++ b/server/lib/httpDrain.js@@ -39,8 +39,12 @@ const refuseDuringDrain = (req, res) => {// Upgrade requests never reach Express — there is no `res` to write through,// only the raw socket handed to every 'upgrade' listener.const refuseUpgradeDuringDrain = (req, socket) => {- if (socket.writable) socket.write('HTTP/1.1 503 Service Unavailable\r\nConnection: close\r\n\r\n');- socket.destroy();+ // Write the 503 response. The callback ensures the write is flushed before+ // destroying the socket, preventing data loss if the socket closes immediately+ // after the write is queued (#8389).+ socket.write('HTTP/1.1 503 Service Unavailable\r\nConnection: close\r\n\r\n', () => {+ socket.destroy();+ });};export const createHttpDrain = (servers) => {