Fire and forget other user notif

This commit is contained in:
MartinBraquet
2025-10-22 15:00:41 +02:00
parent f4f28a411e
commit 57eafa95ba

View File

@@ -104,7 +104,6 @@ export const createPrivateUserMessageMain = async (
if (!authorized)
throw new APIError(403, 'You are not authorized to post to this channel')
await notifyOtherUserInChannelIfInactive(channelId, creator, content, pg)
await insertPrivateMessage(content, channelId, creator.id, visibility, pg)
const privateMessage = {
@@ -127,6 +126,12 @@ export const createPrivateUserMessageMain = async (
broadcast(`private-user-messages/${otherUserId}`, {})
})
// Fire and forget safely
void notifyOtherUserInChannelIfInactive(channelId, creator, content, pg)
.catch((err) => {
console.error('notifyOtherUserInChannelIfInactive failed', err)
});
track(creator.id, 'send private message', {
channelId,
otherUserIds,