release: promote develop → main (staging) #5

Merged
chrnx merged 164 commits from develop into main 2026-07-18 19:01:55 +00:00
Showing only changes of commit e9357efb5c - Show all commits
+11 -3
View File
@@ -99,9 +99,17 @@ export function serveDeno(app: App, options?: DenoServeOptions): DenoHttpServer
return Deno.serve(options ?? {}, (request, info) => {
if (request.headers.get('upgrade')?.toLowerCase() === 'websocket') {
const { socket, response } = Deno.upgradeWebSocket(request);
// fire-and-forget: the graph runs after we return the upgrade response.
// runWsConnection swallows its own errors (closeOnError), so nothing escapes.
void app.upgrade(toWsRequest(request, info), denoSocket(socket));
// Fire-and-forget: the upgrade response must be returned synchronously while
// the graph runs. app.upgrade can reject BEFORE runWsConnection's own try/catch
// (mesh-before-listen throw, or a provider boot failure), so guard the call here —
// an uncaught rejection would be fatal on Deno and crash the whole server.
void app.upgrade(toWsRequest(request, info), denoSocket(socket)).catch(() => {
try {
socket.close(1011, 'internal error');
} catch {
/* already closed */
}
});
return response;
}