Skip to content

Commit

Permalink
Fixed double webhook error (#6404)
Browse files Browse the repository at this point in the history
  • Loading branch information
mw2000 authored Feb 8, 2024
1 parent 1d0b6e9 commit 55c4fe1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/commonwealth/server/util/webhooks/dispatchWebhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ export async function dispatchWebhooks(
return;
}

if (
notification.categoryId === NotificationCategories.NewComment &&
notification.data?.parent_comment_id
) {
// If parent comment exists we don't want to send a webhook.
// Otherwise we will duplicate send a webhook for every reply to a comment.
return;
}

if (!webhooks) {
webhooks = await fetchWebhooks(notification);
}
Expand Down

0 comments on commit 55c4fe1

Please sign in to comment.