From 4f34d4d8febda0161f4817dfcd54a0f061c92fee Mon Sep 17 00:00:00 2001 From: Claas Date: Sun, 28 Dec 2025 20:55:37 +0100 Subject: [PATCH] Add more logs to help debugging --- app/src/service-worker/serviceWorker.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/service-worker/serviceWorker.ts b/app/src/service-worker/serviceWorker.ts index 3ad6c8f..526e291 100644 --- a/app/src/service-worker/serviceWorker.ts +++ b/app/src/service-worker/serviceWorker.ts @@ -279,29 +279,36 @@ const handler = { }, async sendMessage(request: SendMessageRequest) { + console.debug("[Serviceworker] Sending message", request); const message: OutgoingMessage = { type: "outgoing", sentAt: request.sentAt, text: request.text, }; + console.debug("[Serviceworker] Broadcasting message"); broadcastMessage({ type: "Message added", groupId: request.groupId, message, }); + console.debug("[Serviceworker] Storing message"); // Storing the message should happen even if sending fails as that can be retried const storeMessage = pushMessage(request.groupId, message); const client = await getClient; + console.debug("[Serviceworker] Packing message"); const body = client.send_message(request.groupId, { sent_at: request.sentAt.toISOString(), text: request.text, }); assertNotShared(body); - await Promise.all([postMessage(request.friendId, body), storeMessage]); + console.debug("[Serviceworker] Posting message"); + const [response] = await Promise.all([postMessage(request.friendId, body), storeMessage]); + + console.debug("[Serviceworker] Message sent", response.status); }, async wipe() { -- 2.51.2