fix: make web inbox non-blocking

This commit is contained in:
Peter Steinberger
2025-12-20 18:24:05 +01:00
parent b13723d3d7
commit ea5333e5f7
2 changed files with 50 additions and 8 deletions

View File

@@ -227,12 +227,13 @@ export async function monitorWebInbox(options: {
"inbound message",
);
try {
await options.onMessage({
id,
from,
conversationId: from,
to: selfE164 ?? "me",
body,
const task = Promise.resolve(
options.onMessage({
id,
from,
conversationId: from,
to: selfE164 ?? "me",
body,
pushName: senderName,
timestamp,
chatType: group ? "group" : "direct",
@@ -248,8 +249,12 @@ export async function monitorWebInbox(options: {
sendComposing,
reply,
sendMedia,
mediaPath,
mediaType,
mediaPath,
mediaType,
}),
);
void task.catch((err) => {
console.error("Failed handling inbound web message:", String(err));
});
} catch (err) {
console.error("Failed handling inbound web message:", String(err));