mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-04-16 04:27:45 -04:00
Fire and forget other user notif
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user