diff --git a/backend/api/src/junk-drawer/private-messages.ts b/backend/api/src/junk-drawer/private-messages.ts index 7ad5cac3..e6b190bc 100644 --- a/backend/api/src/junk-drawer/private-messages.ts +++ b/backend/api/src/junk-drawer/private-messages.ts @@ -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,