fix: Duplicate mentions results in duplicate notifications (#5585)

This commit is contained in:
Tom Moor
2023-07-21 08:49:14 -04:00
committed by GitHub
parent d180ecbe96
commit dbd85d62cb
4 changed files with 17 additions and 3 deletions

View File

@@ -21,11 +21,13 @@ export default class CommentUpdatedNotificationsTask extends BaseTask<CommentEve
const mentions = ProsemirrorHelper.parseMentions(
ProsemirrorHelper.toProsemirror(comment.data)
).filter((mention) => event.data.newMentionIds.includes(mention.id));
if (mentions.length === 0) {
return;
}
const userIdsMentioned: string[] = [];
for (const mention of mentions) {
if (userIdsMentioned.includes(mention.modelId)) {
continue;
}
const recipient = await User.findByPk(mention.modelId);
if (