From d31c5d7a2c8c243b7159d15de038f5922cf99b69 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 26 Dec 2025 11:39:48 +0100 Subject: [PATCH] style: format web inbound --- src/web/inbound.ts | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/src/web/inbound.ts b/src/web/inbound.ts index 62222c1aa..8599eea8c 100644 --- a/src/web/inbound.ts +++ b/src/web/inbound.ts @@ -307,27 +307,27 @@ export async function monitorWebInbox(options: { const handleConnectionUpdate = ( update: Partial, ) => { - try { - if (update.connection === "close") { - const status = getStatusCode(update.lastDisconnect?.error); - onCloseResolve?.({ - status, - isLoggedOut: status === DisconnectReason.loggedOut, - error: update.lastDisconnect?.error, - }); - } - } catch (err) { - inboundLogger.error( - { error: String(err) }, - "connection.update handler error", - ); + try { + if (update.connection === "close") { + const status = getStatusCode(update.lastDisconnect?.error); onCloseResolve?.({ - status: undefined, - isLoggedOut: false, - error: err, + status, + isLoggedOut: status === DisconnectReason.loggedOut, + error: update.lastDisconnect?.error, }); } - }; + } catch (err) { + inboundLogger.error( + { error: String(err) }, + "connection.update handler error", + ); + onCloseResolve?.({ + status: undefined, + isLoggedOut: false, + error: err, + }); + } + }; sock.ev.on("connection.update", handleConnectionUpdate); return { @@ -338,10 +338,7 @@ export async function monitorWebInbox(options: { sock.ev.off("connection.update", handleConnectionUpdate); } else { sock.ev.removeListener?.("messages.upsert", handleMessagesUpsert); - sock.ev.removeListener?.( - "connection.update", - handleConnectionUpdate, - ); + sock.ev.removeListener?.("connection.update", handleConnectionUpdate); } sock.ws?.close(); } catch (err) {