Skip to content

Commit 57eafa9

Browse files
committed
Fire and forget other user notif
1 parent f4f28a4 commit 57eafa9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

backend/api/src/junk-drawer/private-messages.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ export const createPrivateUserMessageMain = async (
104104
if (!authorized)
105105
throw new APIError(403, 'You are not authorized to post to this channel')
106106

107-
await notifyOtherUserInChannelIfInactive(channelId, creator, content, pg)
108107
await insertPrivateMessage(content, channelId, creator.id, visibility, pg)
109108

110109
const privateMessage = {
@@ -127,6 +126,12 @@ export const createPrivateUserMessageMain = async (
127126
broadcast(`private-user-messages/${otherUserId}`, {})
128127
})
129128

129+
// Fire and forget safely
130+
void notifyOtherUserInChannelIfInactive(channelId, creator, content, pg)
131+
.catch((err) => {
132+
console.error('notifyOtherUserInChannelIfInactive failed', err)
133+
});
134+
130135
track(creator.id, 'send private message', {
131136
channelId,
132137
otherUserIds,

0 commit comments

Comments
 (0)